Comments (6)
Thanks for reporting, yes currently these cases are not supported in DELETE, INSERT and UPDATE statements, the main reason is that the join method is not supported in all db engines, for example in Postgres, so don't know what is the best way to handle this, maybe we can:
- converting the join to a CTE or subquery (while I don't recommend such implicit conversion)
- or throw an exception to the user for the unsupported engines
- or compile it and let the user handle these cases
4 or ignore it at all (current)
What do you think ?
from querybuilder.
for the moment, I agree that we should mention this in the docs, could you open an issue there please, or I do it myself ?
from querybuilder.
I will open the issue there later if I don't see it already.
Yeah, I don't think making the implicit conversion is the way to go--I was just looking up the USING statement in postgres but I'd have to come back to that.
In a local dev branch, I've started to build onto the UPDATE/INSERT for sqlserver compiler as well as add tests. I think since the library already just ignores the unsupported statement it can stay that way until someone finds a reason not to silently ignore it.
from querybuilder.
Any updates on adding join to insert/update/delete. Eagerly waiting for it. Was looking for a solution for SQLServer.
from querybuilder.
@punssoma
Do you have a proposal on how this can be accomplished in the following database:
- Sql Server
- MySql
- PostgreSql
for the time being I suggest using subqueries something like
// delete the books where with AuthorId = 1
db.Query("Books").WhereIn("Id", q => q.From("Books").Join("Authors").Where("Authors.Id", 1).Select("Id"))
from querybuilder.
@ahmad-moussawi Thanks for the tip.
No proposal as of now. Let me try something locally and then may be i can suggest
from querybuilder.
Related Issues (20)
- Vulnerability in System.Private.Uri as result of dependency on System.Collections.Concurrent/4.3.0
- Oracle connection pooling with SqlKata
- Can you please include https://github.com/sqlkata/querybuilder/commit/f3d7c924f4d11c33056d7b002f9d5066dc856117 & re-publish 2.4.0 ?
- RobiniaDocs API Explorer
- Compile query with parameters for ODBC Connection
- Assigning NULL value to column with AsUpdate throws NotSupportedException HOT 1
- db access where day error No value given for one or more required parameters.
- [SQLServer] insert bool value #437
- Possible documentation error
- Distinct AsCount error
- Vulnerability in System.Text.RegularExpressions 4.3.0
- FromRaw can't translate list type parameter properly HOT 1
- how to use include HOT 2
- Question: Combining multiple Statements HOT 1
- Error on WhereContains HOT 1
- Getting Raw SQL from the package, without passing it to the database engine HOT 5
- Error when trying to insert into Always Encrypted column
- SqlServerCompiler Limit generates different query on compile compared to previous versions HOT 3
- Postgres over-escaping ?
- `With` missing if defined in sub query HOT 2
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 querybuilder.