Releases: Sharaal/sql-pg
Releases · Sharaal/sql-pg
v10.4.1
Support `sql.js` instead of a `pg.js` to initialize migration script
Major
- The
pg.jswas located in the root directory and returned the initializedpgclient. This is not anymore supported and instead of that asql.jsis supported, which initialize thepgclient together with thesqlobject and returns both
Support JSON columns
Minor
.jsonColumnObject()and.jsonColumnText()are available to Support JSON columns (#50)
Test the publishing package
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
Patch
- Fixed missing include of the src files in the published NPM package
Disallow update/delete without conditions
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
Minor
symbolis now part of the sql object, so every extension could use it to validate the sql object against it. Currently onlysql.querymake use of this (#44)
Patch
Cleaning up of unneeded default for "pairs"
Patch
- Cleaning up of unneeded default for "pairs"
Finally the production ready release
Major
- The
sql``tag not anymore return the function with text and values assigned. So if it's used with a native pgclientinstance, 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
clientinstance and an actual database (#42 and #34)