Re:AWS Aurora Serverless v2: architecture, features, pricing...
by vadorequest on Thursday March 25, 2021 @12:13PM
(#26582063)
I dislike the `q.` too, for many reason. One of which is it's not copy/paste friendly from code to Shell.
But it's just sugar, I basically write it the way you mentioned, by deconstructing `q`. See https://github.com/Vadorequest/rwa-faunadb-reaflow-nextjs-ma...
Re:AWS Aurora Serverless v2: architecture, features, pricing...
by evanweaver on Thursday March 25, 2021 @12:30PM
(#26582270)
Fauna has no native syntax, instead it has language-specific DSLs. This helps with type safety and query composability but it does indeed lead to awkward syntactical situations when the host language and Fauna semantics don’t quite align.
The snippet in the grandparent post is JavaScript; is there an ORM or other library that has an example of an idiomatic JS or Typescript syntax that either of you would prefer?
Re:AWS Aurora Serverless v2: architecture, features, pricing...
by mwakerman on Thursday March 25, 2021 @04:32PM
(#26585016)
I’ve really enjoy writing queries in RethinkDB’s [REQL language](https://rethinkdb.com/docs/introduction-to-reql/)
> ‘r.table(“users”).filter(u => u(“email”).match(“.*@gmail.com$”)).run(conn)’
Re:AWS Aurora Serverless v2: architecture, features, pricing...
by nicoburns on Thursday March 25, 2021 @12:55PM
(#26582590)
Knex syntax (http://knexjs.org/) is reasonable. It's basically method chaining.
Re:AWS Aurora Serverless v2: architecture, features, pricing...
by giorgioz on Thursday March 25, 2021 @02:04PM
(#26583416)
mongodb is so well integrated with Javascript and JSON.
db.collection().find({}) is just so fluent.
I find all those capitalized functions in Fauna weird. In most C based languages like Javascript functions are lowercase.
Would it be possible for the Fauna JS wrapper to also accept lowercased functions?
Re:AWS Aurora Serverless v2: architecture, features, pricing...
by giorgioz on Thursday March 25, 2021 @02:01PM
(#26583384)
any idea how to lowercase all those capitalized functions?
Re:AWS Aurora Serverless v2: architecture, features, pricing...
by pier25 on Thursday March 25, 2021 @04:30PM
(#26584998)
> Maybe that could be changed with: let { Create, Collection} = q
Yeah, I do that all the time. It makes FQL code much cleaner.
var createP = client.query( q.Create( q.Collection('test'), { data: { testField: 'testValue' } } ) )
https://docs.fauna.com/fauna/current/drivers/javascript
Why those capitalized functions names .Create() and .Collection()? Also the fact that you have to pass around that q. Maybe that could be changed with: let { Create, Collection} = q
I care about the syntax of the libraries I use and Fauna seems clumsy.