Open elhigu opened 6 years ago
Can you give example of defining custom Client? I have not standard sqlite driver and want implement Client for it. What interface for driver I have to implement?
@elhigu Correct me if I'm wrong, but probably custom dialect is going to be identical to any existing dialect, right? @webleaf So you basically you can take https://github.com/tgriesser/knex/tree/master/src/dialects/sqlite3 folder as a basic of what a custom dialect is supposed to look like (as a client you would pass instance of https://github.com/tgriesser/knex/blob/master/src/dialects/sqlite3/index.js)
@kibertoad thank you for answer. What this method should return? https://github.com/tgriesser/knex/blob/461868b61491ab6bccbadc719449718a69399558/src/dialects/sqlite3/index.js#L33-L35 Does is it used internally by knex? Because in my case instead node sqlite3, I have own with other interface.
@webleaf This sounds something for internal use mostly, so whatever external dependency you rely on, I think, if any.
In contributing.md is example code for it. If driver API is different you probably need to override more stuff, but you can start with that driver and probably query methods and how to create connections.
Original issue / PR of the feature found here https://github.com/tgriesser/knex/issues/1440 and https://github.com/tgriesser/knex/pull/1428 and other usage example here https://github.com/tgriesser/knex/issues/2285