Trilogy Versions Save

TypeScript SQLite layer with support for both native C++ & pure JavaScript drivers.

v2.0.0-rc.1

5 years ago

v1.4.5

6 years ago

No changes since 1.4.4 - this release restores the v1 release line to the latest tag, where a v2 beta was accidentally published.

v2.0.0-beta.2

6 years ago

v1.4.4

6 years ago
BUG FIXES
  • enforcers: groupBy -> group (3eaed9a)

v1.4.3

6 years ago
BUG FIXES
  • handle tuple where clauses correctly (efbea74)

v1.4.2

6 years ago
BUG FIXES
  • create: prevent error while searching for last object (5379bb5)
  • types: handle nullish values when casting (e8193c6), closes #79
PERFORMANCE
  • util: use indexOf instead of some() (559dbe0)

v1.4.1

6 years ago

Small patch for TypeScript users to correctly export types.

BUG FIXES
  • types: fix TypeScript typings (#75) @IKnowBashFu

v1.4.0

6 years ago
FEATURES
  • model: allow multiple indices in model definitions, #72 (07ebe16)

v1.3.0

6 years ago

This release brings a pair of exciting features!

First up is the ability to define getters and setters when creating models. These are useful for things like formatting after selects and conforming data before inserts.

const people = await db.model('people', {
  name: String,
  username: {
    type: String,
    get (username) {
      return `username is: ${username}`
    },
    set (username) {
      // remove anything that isn't alphanumeric or underscore
      return username.replace(/[^\w]/gi, '')
    }
  }
})

await people.create({
  name: 'Bo Lingen',
  username: 'ci.ty]ci[d/e'
})
// -> { name: 'Bo Lingen', username: 'citycide' }

await people.get('username', { name: 'Bo Lingen' })
// -> 'username is: citycide'

// can use `getRaw()` and `setRaw()` to bypass getters / setters
// other methods may also accept a `raw` property in their options object
await people.getRaw('username', { name: 'Bo Lingen' })
// -> 'citycide'

There's also a new memory-only mode - if the file path is exactly ':memory:', no file will be created and an in-memory store will be used. This doesn't persist any data but is useful for speed and performance reasons. For example, most of trilogy's tests now use in-memory databases to avoid tons of disk usage.

const db = new Trilogy(':memory:')
BUG FIXES
  • always return promises in async functions (009f079)
FEATURES
  • add support for in-memory database (8587f4b)
  • add getters & setters (ab5cd7b)
  • add getRaw() & setRaw() (5fe1f80)
PERFORMANCE
  • model: use assignments in constructor (73e6ebd)
  • util: optimize each() and map() (040084d)

v1.2.1

6 years ago
BUG FIXES
  • immediately create db file for both clients (7423312)
  • fix .mjs module by removing module.exports usage (e1d57c3)