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 4 years ago

Breaking Changes

  • Update compile target to node 12.19.0 (#115)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Breaking Changes

  • Update compile target to node 12.19.0 (#115)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Breaking Changes

  • Update compile target to node 12.19.0 (#115)

  • Updated @databases/sql to 3.0.0 (#114)

    This means:

    • queries no longer have .compile() or .compileMySQL() methods
    • queries no longer have .text or .values properties
    • SQLQuery is only a type, not a class.

    If you were previously using instanceof SQLQuery to check if a value is an SQLQuery, you can swap to using isSqlQuery.

    If you were relying on the properties or methods to get the actual query text, please open an issue.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Breaking Changes

  • Update compile target to node 12.19.0 (#115)

  • Updated @databases/sql to 3.0.0 (#114)

    This means:

    • queries no longer have .compile() or .compileMySQL() methods
    • queries no longer have .text or .values properties
    • SQLQuery is only a type, not a class.

    If you were previously using instanceof SQLQuery to check if a value is an SQLQuery, you can swap to using isSqlQuery.

    If you were relying on the properties or methods to get the actual query text, please open an issue.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Breaking Changes

  • Update compile target to node 12.19.0 (#115)

  • Removed .compile() and .compileMySQL() methods & removed the .text and .values properties (#114)

    These are replaced by the new .format(...) method that allows consumers of SQLQuerys to decide how to format them and how to escape identifiers.

    This helps keep the library small and light. It also makes it more flexible to use with different database engines.

  • Only export the type for SQLQuery and not the class (#114)

    This prevents people accidentally importing & calling the methods on SQLQuery directly, instead of via sql. If you were previously using instanceof SQLQuery to test if a value is an SQLQuery, use isSqlQuery

  • We "de-indent" queries automatically (#114)

    Instead of attempting to "minify" postgres queries, we now "de-indent" all queries. i.e. we remove excess whitespace from the front of each line by default.

New Features

  • Serializes the native JavaScript bigint type as a string (#118)

    Most databases correctly interpret the string as a BIGINT

  • Add __dangerous__constructFromParts method (#116)

    This is mainly intended for internal use in utilities like @databases/split-sql-query

  • Add isSqlQuery helper (#114)

  • Add .format(...) method to SQLQuery (#114)

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

New Features

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

Published by ForbesLindesay almost 4 years ago

New Features

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

Published by ForbesLindesay almost 4 years ago

New Features

  • You can now provide a defaultConnection when constructing the typed API (#113)

    If you provide a default connection, the connection will then be optional within the table API:

    import createConnectionPool from '@databases/pg'
    import tables from '@databases/pg-typed'
    
    const db = createConnectionPool()
    const {users} = tables<Schema>({defaultConnection: db})
    
    // this uses the default connection
    await users().selectOne({id: 42})
    
    await db.tx(async tx => {
      // this uses `tx` as the connection so it works with transactions
      await users(tx).selectOne({id: 42})
    })
    
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Bug Fixes

  • Allow any version of @databases/pg in peerDependencies (#112)

    This would have caused a warning from yarn when installing @databases/pg-typed

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Refactorings

  • Update @databases/pg-data-type-id to remove "composite" built in types (#112)

    These actually represent tables within the pg_catalog schema, and their IDs tend not to be stable across multiple Postgres versions.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Bug Fixes

  • Removed prettier from peerDependencies (#112)

    An earlier version of @databases/pg-migrations made use of prettier internally, but this version does not.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Refactorings

  • Update @databases/pg-data-type-id to remove "composite" built in types (#112)

    These actually represent tables within the pg_catalog schema, and their IDs tend not to be stable across multiple Postgres versions.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Breaking Changes

  • Remove "composite" built in types (#112)

    These actually represent tables within the pg_catalog schema, and their IDs tend not to be stable across multiple Postgres versions.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Bug Fixes

  • Fix insertOrUpdate, insertOrIgnore and update (#110)

    All methods now also have at least one test covering them.

atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

New Features

  • Improve error message for non-alphanumeric identifiers (#110)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

Bug Fixes

  • Allow re-exporting table types (#109)
atdatabases - @databases/[email protected]

Published by ForbesLindesay almost 4 years ago

New Features

  • Define and export new types for Queryable, Transaction, Task and ConnectionPool (#105)

    In the long term, Queryable should replace Connection as the go to interface name for an object that lets you query the database. This is because a Connection can currently be a Transaction or ConnectionPool in addition to a regular connection.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Breaking Changes

  • Output now requires TypeScript 3.8 or higher (#108)

    This is because we make use of the export type {Name} syntax required to support isolated modules and incremental build.

Bug Fixes

  • Add type keyword to exports to support incremental build & isolated modules (#108)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Breaking Changes

  • Output now requires TypeScript 3.8 or higher (#108)

    This is because we make use of the export type {Name} syntax required to support isolated modules and incremental build.

Bug Fixes

  • Add type keyword to exports to support incremental build & isolated modules (#108)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

New Features

  • Initial release (#105)