Custom backend resources/outline? #4619
-
Hi, I'd like to get Diesel working for e.g. ClickHouse projects and was wondering: (a) What's the general amount of work involved in making a custom connection + backend? Can I just implement any arbitary subset of the dialect to meet my needs, or does Diesel require a certain coverage of implementation to work at all? (b) Are there any third party backend crates out there that are considered 'good' implementations and that I can take a look at? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is some general documentation on that topic here and here. You need to implement most of the traits listed there to get basic functionality. You need at least
I'm aware of the following third party backends: Also the in tree backends/connections can serve as and example. diesel-async can serve as example how to only use a partial set of the traits listed above and replace others with different (but conceptually similar) interfaces. I hope that gives you at least a clue where to start. Otherwise I'm also happy to provide pointers for specific problems as long as the code is open source. |
Beta Was this translation helpful? Give feedback.
There is some general documentation on that topic here and here. You need to implement most of the traits listed there to get basic functionality. You need at least
LoadConnection
,Connection
,Backend
,SqlDialect
, all theHasSqlType’,
FromSqland
ToSqlimpls. Likely you also need
BindCollectorand
QueryBuilderif you cannot use and existing one. Depending on the choices you make while implementing them (especially
SqlDialectand
HasSqlType`) additional impls migh…