Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Malik Benkirane
Malik Benkirane

Posted on

surrealdb driver github.com/4sp1/surrealhigh

❓Open-Source
❓Side-Project
❓SurrealDB driver

👤 Surreal High "Coming Out"

Open Source Side Project

Higher level interface to the amazing SurrealDB Rusty DB engine featuring NoSQL, GraphDB, sqlDB with an original query language with permissions and more. They finally release the production edition.

I think Golang interface is lacking behind so I wrote a very handcrafted layer above the existing Go driver to make integrations and tasks easier. Indeed, this is a little trick to generate types for all of the data structures fields you would like to work with. At the moment support is limited and I already alpha tested it with 2 other side projects where I wanted to try a little more SurrealDB. Of course I have more projects to come so this will make the overall product better.

Also there is very basic and incomplete query constructors but it should be seamlessly easy for you to start a discussion so we could get it done together!

Looking forward to your feedback,
Back to you!

Malik

PS

❓Techinality
❓Usability
❓Underground

👤 Install

https://github.com/4sp1/surrealhigh/commit/054984e9ac31

The link would get you to the version you should use

go install ./cmd/sh-gen-types
Enter fullscreen modeExit fullscreen mode

then in the package for your surrealdb adapter define some struct and for example prepose it with

👤 Use

//go:generate sh-gen-types -doc=myDoc -pkg=mysdbdriver -o my_doc.sdb.gen.gotypemyDocstruct{//... non strictly typed doc}
Enter fullscreen modeExit fullscreen mode

👤 Hack

also have a look at the few following flags and meanings

var(doc=flag.String("doc","","comma-separated list of doc struct names; must be set")pkg=flag.String("pkg","","destination package")out=flag.String("o","","destination file .go"))
Enter fullscreen modeExit fullscreen mode

fromhttps://github.com/4sp1/surrealhigh/blob/054984e9ac3130d4326f608351d316c88f772ac0/cmd/sh-gen-types/main.go

the whole thing is backed with some template generator with some good and bad sides but it was worth trying and that might happen again:

👤 Dig

// :Dimport "github.com/4sp1/surrealhigh/templates/jennifer"
Enter fullscreen modeExit fullscreen mode

🏁 We're done! It's amazing if you get done to the line

🎪🎪🎪

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

<3golang, tdd, cloud, distributed systems paradigms, clean arch, ddd, but also probabilistic learning algorithmic and analytic, some svelte, some vuejs, very few react, and angular when needed
  • Education
    Bachelor's in CS at Sorbonne Université (Paris Jussieu)
  • Work
    Golang Senior Software Engineer
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp