Comments (3)
Since the write needs the type, query and option sometime, it's very confusing if we still allow type to be placed in the top level of query object. We should just put the type in the query, insert or update, they can specify the type just for query or write.
I see what you're saying. I'd like type
as a top level key for simple queries that are query only. So this would be a valid query:
{
"type": "STANDARD",
"field": "name",
"match": "Bob"
}
The type
here shouldn't really apply to writes, since values for type
are things like AND
and OR
.
If anything, writes should have their own types, values being INSERT
, UPDATE
, and RAW
. Does that sound reasonable?
from franca-js.
@chen-factual I see, so the reason I think keeping type
at the top level might be confusing because we may assign different types for query
and write
(like update
), for instance:
{
"type": "RAW",
"table": "example-table",
"query": {
"field": "field1",
"match": "baz"
},
"upsert": {
"$set": {
"field2": "boo",
"field3": "bar"
},
"$setOnInsert": {
"field1": "baz",
"field2": "boo",
"field3": "bar"
}
}
}
So in this case, upsert
is raw
but query
is just a standard query. Do you think we need this kind of query object in practice?
from franca-js.
I can see a corner use case for it, but in the interest of simplifying things I'd be glad if we enforce RAW to apply to everything, instead of selectively to just one or the other.
from franca-js.
Related Issues (13)
- Requiring from Repl Throwing HOT 10
- Does franca support `join` query? how hard is it to implement this lib using ruby? HOT 1
- Add support for mongo ID query HOT 3
- Make match query support "null" value
- back to back translations trigger exception
- postgres: escape ' characters in match values
- spec out insert / update format HOT 10
- improve postgres RAW query support
- Implement Insert component
- Implement Update component
- Implement Remove component
- Implement Write Operation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from franca-js.