atdatabases

TypeScript clients for databases that prevent SQL Injection

MIT License

Downloads
4.4M
Stars
588
Committers
23

Bot releases are visible (Hide)

atdatabases - @databases/[email protected] Latest Release

Published by ForbesLindesay 8 months ago

New Features

  • You can pass multiple keys to cachedFn.cache.delete(...keys) now for both dedupeAsync and dedupeSync. If the underlying cache/map accepts a ... spread parameter, the array of keys will be passed directly to the undelrying map. Otherwise .delete will be called multiple times on the underlying map. (#319)

  • A new method has been added for cachedFn.cache.deletePrefix(prefix) for both dedupeAsync and dedupeSync. (#319)

    If the map used as the cache is a MultiKeyMap, deletePrefix takes any sub-path for the key. e.g. MultiKeyMap<[string, number, string]> would result in a deletePrefix function that accepts [string] | [string, number] as the key.

    If the map used as the cache has a deletePrefix method, the prefix is passed directly to that method.

    If the keys are serialized to a string, deletePrefix accepts a string and will delete keys where the serialized value matches that string.

atdatabases - @databases/[email protected]

Published by ForbesLindesay 8 months ago

Bug Fixes

  • If 0 parameters are passed to .delete it will no longer generate a DELETE_MULIPLE event for replication. (#319)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 8 months ago

Bug Fixes

  • Provide slightly stricter types for TypeScript (#318)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 8 months ago

New Features

  • Added Cache.deletePrefix(prefix). This lets you delete all keys with a given prefix from the cache. deletePrefix will throw an error if any of the keys are not serialized to a string. They can either already be strings, or you can use mapKey to convert them into strings if you want to use this method. (#317)

    Using this method with replication enabled will result in this new type of replication event:

    interface ReplicationDeletePrefixEvent {
      readonly kind: 'DELETE_PREFIX';
      readonly name: string;
      readonly prefix: string;
    }
    
  • You can now pass multiple keys to Cache.delete(...keys) to more efficiently delete multiple keys in a single call. (#317)

    Passing multiple keys with replication enabled will result in this new type of replication event:

    interface ReplicationDeleteMultipleEvent {
      readonly kind: 'DELETE_MULTIPLE';
      readonly name: string;
      readonly keys: unknown[];
    }
    

Bug Fixes

  • Provide slightly stricter types for TypeScript (#318)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 9 months ago

New Features

  • Partitioned tables support (#309)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 9 months ago

New Features

  • Partitioned tables support (#309)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 9 months ago

New Features

  • Partitioned tables support (#309)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 9 months ago

Bug Fixes

  • Use SHOW server_version to detect Postgres version. Hopefully allowing pg-migrations to be used with other database systems as long as they have a compatible wire-protocol. (#279)
atdatabases - @databases/[email protected]

Published by ForbesLindesay 9 months ago

Breaking Changes

  • Initial release (#285)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 1 year ago

Refactors

  • Remove (deprecated) cuid dependency (#308)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 1 year ago

Refactors

  • Use crypto.randomUUID() instead of cuid() (#308)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

Refactors

  • Bumps better-sqlite3 to v8.0.0 (#295)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

Bug Fixes

  • Bump @databases/mysql dependency to 6.0.0 (#297)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

Breaking Changes

  • NULL will no longer be parsed to NaN when using "number" for tinyIntMode (#297)

  • NULL will no longer be parsed to false when using "boolean" for tinyIntMode (#297)

  • NULL will no longer be parsed to NaN when using "number" for bigIntMode (#297)

  • NULL will no longer error when using "bigint" for bigIntMode (#297)

  • NULL will no longer error when using "date-object" for dateMode (#297)

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

Bug Fixes

  • The default export would not work if imported in an ESModules context in node.js (#293)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

Bug Fixes

  • Sub-queries that were guaranteed to be false could result in attempting to execute SQL that was not syntactically valid. (#288)

    For example, given the function:

    async function getUsersThatCreatedPhotos(photoIds: DbPhoto["id"][]) {
      return await users(db)
        .find({id: photos.key(`created_by_id`, {id: anyOf(photoIds)})})
        .all()
    }
    

    Calling:

    getUsersThatCreatedPhotos([])
    

    should return a Promise for an empty array, without actually needing to query the database, but instead it attempted to run a database query that was not valid SQL.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

New Features

  • Added support for config files with .cjs extension (#287)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 1 year ago

New Features

  • Added support for config files with .cjs extension (#287)
atdatabases - @database/[email protected]

Published by ForbesLindesay over 1 year ago

Initial Release

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

New Features

  • Initial Release (#275)