atdatabases

TypeScript clients for databases that prevent SQL Injection

MIT License

Downloads
4.4M
Stars
588
Committers
23

Bot releases are hidden (Show)

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Bug Fixes

  • Update interrogator dependency to remove broken TypeScript definitions (#275)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Bug Fixes

  • Update interrogator dependency to remove broken TypeScript definitions (#275)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Bug Fixes

  • Update interrogator dependency to remove broken TypeScript definitions (#275)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Bug Fixes

  • Update interrogator dependency to remove broken TypeScript definitions (#275)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

New Features

  • Added SQLQuery.toSql() method to allow you to get the SQLQuery generated by pg-typed without executing it against the database. This can allow you to generate type safe parts of larger, more complex queries. (#268)

  • Added Table.conditionToSql(whereCondition) utility to convert a type safe condition to the condition part of an SQLQuery. This can be used to generate type safe conditions for queries that require a join or other more complex operation. (#268)

  • Added SQLQuery.distinct(...columnNames) utility to allow you to request only distinct rows without indicating a required sort order. (#268)

  • Allowed arbitrary SQLQuerys to be passed to the .find() method, the .andWhere() method and the and/or utilities. This lets you construct mostly type safe queries while still using some unsafe conditions written in raw SQL. (#268)

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Performance Improvements

  • Release connections before running post commit steps (#274)

    This reduces the risk of deadlocks where the post-commit step might be waiting for a connection from the pool while a connection is still being held by the transaction, even though the transaction cannot be used once the post-commit steps begin running.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

New Features

  • Added the isSqlQuery utility to the default sql export so it can be used as sql.isSqlQuery(q) to test whether a value is an SQL query. (#268)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Bug Fixes

  • Transactions were handled incorrectly and could therefore not be rolled back (#263)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 2 years ago

Bug Fixes

  • Detect REINDEX queries (#266)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Transaction rollback failed due to using the wrong keyword (#258)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Types were sometimes generated for ignored tables if referenced by other tables (#256)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Types were sometimes generated for ignored tables if referenced by other tables (#256)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

New Features

  • Sort generated type declarations alphabetically (#257)

    This makes the output more stable when adding & removing foreign keys

  • Add getIgnoreTest utility (#256)

    Given lists of tables to include and ignore, this returns a function to test if a given table should be ignored

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

New Features

  • Add options to ignore tables when generating types (#254)

    • includeTables - if specified, types will only be generated for the tables listed
    • ignoreTables - if specified, types will not be generated for the tables listed, even if they are also listed in includeTables
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Add options to ignore tables when generating types (#254)

    • types.includeTables - if specified, types will only be generated for the tables listed
    • types.ignoreTables - if specified, types will not be generated for the tables listed, even if they are also listed in types.includeTables
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

New Features

  • Add options to ignore tables when generating types (#254)

    • includeTables - if specified, types will only be generated for the tables listed
    • ignoreTables - if specified, types will not be generated for the tables listed, even if they are also listed in includeTables
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

New Features

  • Add options to ignore tables when generating types (#254)

    • types.includeTables - if specified, types will only be generated for the tables listed
    • types.ignoreTables - if specified, types will not be generated for the tables listed, even if they are also listed in types.includeTables
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Support CommonJS style require (#253)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Prioritise foreign keys over primary keys (#250)

    If a key was both a foreign key and a primary key, we would incorrectly generate a branded type for it, rather than referencing the column being referenced by the foreign key.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 2 years ago

Bug Fixes

  • Force container to run with --platform linux/amd64 (#248)

    This ensures the container works when run on otherwise unsupported platforms such as M1 MacBooks