Skip to content

Fix issue with qualified table names

Compare
Choose a tag to compare
@VinGarcia VinGarcia released this 17 Jan 03:29
· 32 commits to master since this release

As suggested by one user of the KSQL library I should start doing official releases like this one explaining all the changes and updates every time I release a new version.

Since I have not been doing actual releases for a long time (I was only creating tags but with no description of the changes) this release will describe all new features and updates ever since the last version that was officially released, namely: v1.6.0

  • Remove direct import to github.com/lib/pq from the kpgx adapter. This still doesn´t completely remove it from the indirect dependencies because this library is an indirect dependency used on pgx for testing (if I remember correctly).
  • Add kpgx5 adapter. This adapter is just like the kpgx adapter but works using pgx v5 instead of pgx 4.
  • Add modernc-ksqlite adapter. This adapter is just like the ksqlite adapter but it uses the https://pkg.go.dev/modernc.org/sqlite implementation, which, although not being as widely used and battle-tested as the former, does not depend on CGO which is a big advantage in many situations.
  • Remove the deprecated Update() function: use the Patch() function instead (which has the exact same implementation). This function was renamed from Update to Patch because it contains the "patching" feature of automatically ignoring null pointers instead of trying to set the attribute to NULL. This behavior would be counter-intuitive if someone tried to guess its behavior from the name Update. Also having the name Update used for this prevented me from in the future adding an actual Update function on v2, which is something I intend to do, and deprecating/removing this now will probably prevent users from not noticing this subtle difference when updating to v2, so I considered that this breaking change was would probably make the update safer in the future.
  • Move the ksql.Dialect interface to subpackage sqldialect and rename it to sqldialect.Provider.
  • Add ksql.InjectLogger() function for helping debug query errors.
  • When using the Patch() method without providing all required IDs KSQL will now return a ksql.ErrRecordMissingIDs with a more appropriate error message.
  • Fixes an issue that prevented the Insert, Patch and Delete helper functions from working with qualified table names, e.g. public.users.

And that is pretty much all of it, I hope you guys like it