Skip to content

Releases: Sharaal/sql-pg

v10.4.1

14 Sep 12:29
Compare
Choose a tag to compare

Patch

  • Fixed the command name from migrate:make to migrate_make cause it seems : are not allowed (the recommendation in the Wiki is to name it migrate:make in the own user scripts)
  • Removed husky currently, because it runs to often in local environment errors

Support `sql.js` instead of a `pg.js` to initialize migration script

14 Sep 12:39
Compare
Choose a tag to compare

Major

  • The pg.js was located in the root directory and returned the initialized pg client. This is not anymore supported and instead of that a sql.js is supported, which initialize the pg client together with the sql object and returns both

Support JSON columns

21 Nov 12:32
Compare
Choose a tag to compare

Minor

  • .jsonColumnObject() and .jsonColumnText() are available to Support JSON columns (#50)

Test the publishing package

18 Nov 14:21
Compare
Choose a tag to compare

Patch

  • Add testing the publishing package to the CI, so issues of the publish will be detected before the actual publishing (#48)

Fixed missing include of the src files in the published NPM package

13 Nov 12:46
Compare
Choose a tag to compare

Patch

  • Fixed missing include of the src files in the published NPM package

Disallow update/delete without conditions

13 Nov 11:53
Compare
Choose a tag to compare

Major

  • .update() and .delete() manipulation methods throw errors now if called without conditions. If this is needed .updateAll() and .deleteAll() are available (#46)

From:

sql.delete('...')

To:

sql.deleteAll('...')

Modularise the implementation

28 Oct 14:35
Compare
Choose a tag to compare

Minor

  • symbol is now part of the sql object, so every extension could use it to validate the sql object against it. Currently only sql.query make use of this (#44)

Patch

  • Modularised every logical component, like the main helper functions, the manipulation methods, the selection methods and the tag helpers, to have it's own file (#44)
  • Refactored sql.insert to align with the other manipulation methods only have one sql.query for the different use cases (#44)

Cleaning up of unneeded default for "pairs"

18 Oct 11:33
Compare
Choose a tag to compare

Patch

  • Cleaning up of unneeded default for "pairs"

Finally the production ready release

17 Oct 14:13
Compare
Choose a tag to compare

Major

  • The sql`` tag not anymore return the function with text and values assigned. So if it's used with a native pg client instance, it's needed to add the function call building the query (#40)

From:

client.query(sql`...`)

To:

client.query(sql`...`())

But it's still not recommend to use the SQL tag directly with the native pg client.query. Better use the manipulation and selection methods or sql.query() which handles it, so no changes needed if using them:

sql.query(sql`...`)

Minor

  • Added sql.identifier() for a better semantic usage escaping identifiers which are not tables or columns like trigger names (#40)
  • Added integration tests to ensure the library and migration script works with the native pg client instance and an actual database (#42 and #34)

Patch

  • Renamed parameters to values in the query response for the native pg client (#40)
  • Drop trigger before creating one for the updated_at of a table to avoid duplication issues (#40)
  • Remove surrounding " for the SELECT * because it was interpreted as column name (#40)

v7.0.6

15 Oct 12:46
Compare
Choose a tag to compare

Patch

  • Fixed the create migrations table which had a double primary key. The name is now a unique column, not anymore a primary key