Comments (5)
builder.build({
type: 'select',
table: 'table',
fields: ['a'],
condition: {
$or: [
{ b: 1 },
{ c: 1 }
]
}
});
builder.build({
type: 'select',
table: 'table',
fields: ['a'],
condition: {
b: 1,
c: 1,
$or: [
{ d: { $like: 'dd' } },
{ e: { $like: 'ee' } }
]
}
});
from json-sql.
Thanks
first one worked.
second seem something error.
sql.query show follow
select "a" from "table" where "b" = 1 and "c" = 1 and ("d" like $p1 or "e" like $p2);
$p1 $p2 replace the 'dd' and 'ee'
from json-sql.
miss separatedValues : false option
from json-sql.
OK, but it is not safe coz separatedValues: false
enable potential SQL injections.
from json-sql.
if set separatedValues : true, how to use sql text with "$p1 $p2" ,I use node msql(npm install mysql)
I didn't want potential SQL injections. :(
from json-sql.
Related Issues (20)
- Where should I define the schema name to execute query on specific schema for pg? HOT 2
- How to build Greater than or equal to and Less than or equal to HOT 1
- Multiple inner join? HOT 2
- mysql: Invalid query generated when there is a . in the table name HOT 1
- Where not in Condition
- postgre case-insensitive support HOT 2
- How to do a bulk insert? HOT 1
- How to use the modulo operator with json-sql? HOT 2
- Using ROW_NUMBER() HOT 1
- Incorrect syntax near 'returning'. HOT 2
- escape symbols HOT 1
- Condition should accept string
- Sqlite error with object insertion HOT 1
- [mariadb/mysql] does not support named placeholders like :col1 - use ? instead
- Critical Vulnerable module - underscore module HOT 3
- Can I use .msj to run json-sql?
- Feature request: Support for conversion of BSON `ObjectId` to `String`
- Feature request: Support for Buffers (BLOB/Hex)
- Feature request: Support for `null` Object type
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 json-sql.