joy-framework / db Goto Github PK
View Code? Open in Web Editor NEWA database library for janet
A database library for janet
There are two issues at play here:
When a migration fails to parse, the error doesn't indicate which file is failing to parse.
And the migration scanner doesn't just pick up SQL files, it also picks up Kate swap files.
The idea is to turn this:
(def account (db/find :account 1))
(db/update :account account {:name "new name"})
into this:
(def account (db/find :account 1))
(db/update account {:name "new name"})
; which is really
(db/update {:id 1 :db/table "account"} {:name "new name"})
where the result coming out of a db/query
has two keys: :id
and :db/table
Insert could work similarly:
(db/insert {:db/table "account" :name "new name"})
Hello,
thank you for your amazing work on joy.
The pg API seems to have much less functions comparing to the sqlite one (update is missing for example).
I played with it a bit and adding the missing things doesn't look that hard so I can do that.
This could be a macro or maybe an object, not sure yet
(def account (db/table :account))
or
(deftable account)
which would then let you do stuff like this
(account/find 1)
(account/delete 1)
(account/update 1 {:name "new name"})
(account/create {:name "name"})
(account/where {:email "[email protected]"})
(account/where "email != ?" "[email protected]")
Not sure how this would work but it seems interesting
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.