gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit413b11e1413b11e1Record corrected LY7 nesting, exact CSS and Chrome proofmre413b11e1/plugins/mpackdb/testdata/compat/write_a.mjs

1.5 KB

  1. // Cross-compat phase A step 1: the REAL JS mpackdb v1.0.7 writes a db that
  2. // the Zig port (compat_driver.zig verify_a / mutate_a) then reads and mutates.
  3. //
  4. // Setup (mpackdb source + its msgpackr dep live OUTSIDE the repo):
  5. // cp -r /media/STORAGE/projects/mpackdb-reference /tmp/mpackdb-run
  6. // cd /tmp/mpackdb-run && npm install
  7. // Run:
  8. // MPACKDB=/tmp/mpackdb-run node write_a.mjs /tmp/compat/users_a
  9. import { pathToFileURL } from 'url';
  10. const MOD = process.env.MPACKDB || '/tmp/mpackdb-run';
  11. const { default: MPackDB } = await import(pathToFileURL(MOD + '/src/MPackDB.js'));
  12. const dbfile = process.argv[2];
  13. if (!dbfile) throw new Error('usage: write_a.mjs <dbfile>');
  14. const db = new MPackDB(dbfile, { primaryKey: '*id', indexes: ['email', '*age'] });
  15. const id0 = await db.insert({
  16. name: 'Alice Ünicode ✓',
  17. email: '[email protected]',
  18. age: 30,
  19. balance: 1234.56,
  20. tags: ['admin', 'staff'],
  21. profile: { lang: 'de', theme: null },
  22. created: new Date(1721996422123),
  23. });
  24. const id1 = await db.insert({ name: 'Bob', email: '[email protected]', age: 25, big: 5000000000 });
  25. const id2 = await db.insert({ name: 'Carol', email: '[email protected]', age: 35 });
  26. const id3 = await db.insert({ name: 'Dave', email: '[email protected]', age: 40 });
  27. const id4 = await db.insert({ name: 'Eva Müller', email: '[email protected]', age: 28 });
  28. console.log('inserted ids:', id0, id1, id2, id3, id4);
  29. const deleted = await db.delete(id2);
  30. console.log('deleted id=2 (Carol):', deleted.length, 'record(s)');
  31. await db.close();
  32. console.log('JS write_a done');

Branches

Latest commits

  • 413b11e1Record corrected LY7 nesting, exact CSS and Chrome proofmre
  • b810453etracker-demo: nest child and compound selectors in Stylemre
  • 0b5b1d61notes-demo: nest child and compound selectors in Stylemre
  • ab22bdc2mail-demo: nest child and compound selectors in Stylemre
  • fe2d8de9home: nest child and compound selectors in Stylemre
  • e631791buser-menu: nest child and compound selectors in Stylemre
  • 69604944three-pane: nest child and compound selectors in Stylemre
  • 3e389b83main-menu: nest child and compound selectors in Stylemre
  • 05413975list-first: nest child and compound selectors in Stylemre
  • c545b642content-first: nest child and compound selectors in Stylemre
  • eae2be7aapp-sidebar: nest child selectors and document caller-slot gapmre
  • 69c9f784Record LY7 slot nesting blocker and minimal repromre
  • b1d4f379app-header: nest child and compound selectors in Stylemre
  • 6385ff8eRecord LY7 style formatting proof and review statusmre
  • 0100f51etracker-demo: format Style with nested rules and bare mediamre
  • 5f82554enotes-demo: format Style with nested rules and bare mediamre
  • 3dc27d78mail-demo: format Style with nested rules and bare mediamre
  • cf9648afhome: format Style with nested rules and bare mediamre
  • 846a6242user-menu: format Style with nested rules and bare mediamre
  • 4d58708cthree-pane: format Style with nested rules and bare mediamre