Support Nim 2.x, compatibility with waterpark.
- Nim 2.x has moved the DB connectors outside the standard library to the `db_connector` package. - Refactor the pooling implementation and macro expectations to use the `withConnection` name instead of `withConn`. This change allows a caller to use a [waterpark](https://github.com/guzba/waterpark) pool instance instead of the builtin pool instance. Waterpark provides better support for multi-threaded environments. The builtin pooling mechanism may be deprecated in favor of waterpark in the future. - Add the `getModelIfItExists` generated proc to the list of standard procs we generate. This is a flavour of `getModel` that returns an `Option` instead of raising an exception when there is no model for the given id. - Change `PaginationParams#orderBy` to accept a `seq[string]` to allow for sorting on multiple fields.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import std/[db_postgres, db_sqlite]
|
||||
import db_connector/[db_postgres, db_sqlite]
|
||||
|
||||
type DbConnType* = db_postgres.DbConn or db_sqlite.DbConn
|
||||
|
Reference in New Issue
Block a user