Implementing a SurrealDB driver; where is what? #382
Replies: 1 comment
-
I think you either need to send PR to https://github.com/go-rel/sql to support SurrealDB flavor, or create a custom sql builder
yes, I think so REL have embedded structs, but I don't think that's what you want |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there!
I have already written the
database/sql[/driver]
implementation for SurrealDB - but now I would like to add some ORM features, which I initially attempted to do with Gorm... but, just look at this spaghetti code, and you know why I am stuck: https://github.com/IngwiePhoenix/surrealdb-driver/blob/f0fa9b7b9dde2a164e7c49287f1df99938561d60/pkg/gorm/migrator.goI did my very best trying to work off of their existing drivers and their godoc, but, I am hopelessly stuck and it appears that community support is quite sparse... so, I looked for other ORMs, and ended up here :)
So, I want to try to write an adapter for rel. Looking at the MySQL one, I see this: https://github.com/go-rel/mysql/blob/main/mysql.go#L39-L50
My questions are:
REMOVE
is the sort-of equivalent toDROP
for most things, whilstSELECT
straight up lacksJOIN
and instead uses record links, graph edges and other syntaxes. How do I implement a custom syntax off of one of thosebuilder
structs?Thank you and kind regards,
Ingwie
Beta Was this translation helpful? Give feedback.
All reactions