Comments (4)
Sure, this worked fine for select(). for update() I tried the other day and was not working.
thanks, yes it was only working for select().
I've just added concat filter support to ast builder update nodes.
this will be included in the next release.
ref.
Update AST builder UpdateFilterNode .filter(..) behavior, #1455
Update AST builder UpdateNode to enforce .filter(..) before .set(..), #1454
from gluesql.
To use AND or OR expression, you should do like this.
.filter(
col("name")
.not_like(text("D%"))
.and(col("name").not_like(text("M___"))),
)
https://github.com/gluesql/gluesql/blob/main/test-suite/src/ast_builder/expr/pattern_matching.rs#L69
or
.filter("c.name = 'Fruit' OR c.name = 'Meat'")
https://github.com/gluesql/gluesql/blob/main/test-suite/src/ast_builder/select.rs#L85
from gluesql.
Originally I had a misunderstanding on AST builder syntax and I thought adding .filter() multiple times will keep adding nested filter, but turns out every new filter was just overriding another filter.
adding filter multiple times should work like below,
if it wasn't then could you provide the query you tested?
gluesql/core/src/ast_builder/select/filter.rs
Lines 142 to 150 in 235fd6e
from gluesql.
To use AND or OR expression, you should do like this.
.filter( col("name") .not_like(text("D%")) .and(col("name").not_like(text("M___"))), )https://github.com/gluesql/gluesql/blob/main/test-suite/src/ast_builder/expr/pattern_matching.rs#L69 or
.filter("c.name = 'Fruit' OR c.name = 'Meat'")https://github.com/gluesql/gluesql/blob/main/test-suite/src/ast_builder/select.rs#L85
Sure, this worked fine for select(). for update() I tried the other day and was not working.
from gluesql.
Related Issues (20)
- AST Filter: Field without table name should refer to main table instead of joined one by default HOT 1
- Decimal casted to I64 when using conditional statement HOT 3
- Support TimeZone aware queries
- Wrong ordering when using `.order_by("id, number ASC")` HOT 1
- Many `parsing sql CREATE_TABLE` logs when inserting batch data HOT 2
- Make `IndexedDb` storage implement index traits
- Implement `SLICE` in AST builder HOT 1
- Add test cases for ast-builder/functions/text/character-conversion
- Implement `DEDUP` function
- Composite Storage support CTAS HOT 4
- Should we release a patch version for 0.14? HOT 2
- Implement Elixir binding for GlueSQL storages
- What is the recommended way to pass untrusted strings to the AST builder? HOT 1
- Missing impl From<Uuid> for ExprNode HOT 3
- Support for composite primary key
- gluesql-derive: Derive FromGlueSqlRow from Vec<Value> for structs HOT 2
- Performance with persistent tables (Sled) HOT 10
- Support UPSERT HOT 1
- InvalidStateError for IndexedDB Example in Rust WebAssembly Environment
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 gluesql.