ndb.nim icon indicating copy to clipboard operation
ndb.nim copied to clipboard

Add compatibility for nim 2.0

Open PhilippMDoerner opened this issue 1 year ago • 0 comments

With nim 2.0 the packages std/db_sqlite/db_postgres/db_mysql are no longer part of the standard library!

They have been moved into its own package called dbconnector.

It should be as simple as swapping out the imports:

  • std/sqlite3 => db_connector/sqlite3
  • std/db_common => db_connector/db_common

(I don't think I've seen any usage of std/db_postgres or std/postgres so those appear to be not necessary to swap out).

This might be a breaking change, as I'm not sure if db_connector can be used in nim 1.0 versions.

I can confirm for db_sqlite that it works flawlessly with the following 2 changes:

  • in sqlite.nim line 83 to import db_connector/db_common
  • in sqlite3.nim line 18 to import db_connector/sqlite3

I can't say anything about postgres at this time because I can't even get the tests to run under nim 1.6.10

PhilippMDoerner avatar Dec 23 '22 12:12 PhilippMDoerner