davalapar / database

efficient, synchronous, prototyping database
https://www.npmjs.com/package/@davalapar/database
MIT License
1 stars 0 forks source link

v2.x.x progress #2

Open davalapar opened 5 years ago

davalapar commented 5 years ago

polylines

[breaking]

[minor]

[major] finalizing

[minor] fix errors

[breaking] versioning

[breaking] snapshots

// first 1 byte : serialization : 0=json, 1=cbor
// next 1 byte : compression : 0=none, 1=gzip, 2=brotli
// next 1 byte : hash: 0=sha256, 1=sha512-256
// next 1 byte : encryption : 0=none, 1=xsalsa20-poly1305
// next 1 byte : id type : 0=random, 1=counter
// next 8 bytes : counter value : UInt64
// next n bytes : schema hash
// next n bytes : table items

[minor] rollback, commit, snapshot

// db.rollback()
current -> data // readFileSync

// db.commit()
data -> temp // writeFileSync
current -> previous // renameFileSync
temp -> current // renameFileSync

// db.snapshot()
current -> snapshot // copyFileSync

[breaking] improved id

[minor] item property value peek

SomeTable.peek(id, field) -> value; // preferred
SomeTable.get(id, field) -> item|value;

[breaking] add object type

[breaking] triggers / hooks

[breaking] transactions

[breaking] process clustering

[minor] key-value tables

[minor] append-only tables

[?] worker threads

[?] browser-build

[?] readme updates

[?] more usage

const LogTypes = Object.freeze({
  Info: 0,
  Warning: 1,
  Error: 2,
  Success: 3,
});

Logs.add({
  id: Logs.id(), // string
  type: LogTypes.Info, // number
  message: 'X at Y at Z', // string
  context: JSON.stringify({ param1, param2 }), // string
});

[breaking] internal logging

[breaking] database initialization

const db = Database.init({
  tableConfigs: [],
});

[?] reference projects

davalapar commented 5 years ago

fixed (nov 26, 5pm)

davalapar commented 4 years ago
davalapar commented 4 years ago
davalapar commented 4 years ago