Comments (2)
It should work with a CTE , but there is an issue with BOOLEAN literals - I have fixed as part of #5253
e.g
WITH x(some_boolean, tbl2_name) AS (
VALUES
(TRUE, 'name1'),
(FALSE, 'name2')
)
INSERT INTO table1(some_boolean, tbl2_id)
SELECT some_boolean, tbl2.id
FROM x JOIN table2 AS tbl2 ON name = x.tbl2_name;
Subqueries with a column list such as https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-SUBQUERIES , isn't currently implemented as the original core grammar is for Sqlite.
e.g
FROM (VALUES ('anne', 'smith'), ('bob', 'jones'), ('joe', 'blow'))
AS names(first, last)
from sqldelight.
@griffio Thanks for your response :)
Good to know that this could work with a CTE, but what if the number of insertion values aren't pre-defined? Meaning, it could be n
number of entries at runtime (This could be referenced to #5254).
Regarding the core of the issue, I think that if it's possible from within a CTE that it's probably not that big of a deal, but still - It might be beneficial to support it to allow a wider range of queries supported by SQLDelight. (As per your example with SQLite)
from sqldelight.
Related Issues (20)
- R2dbcPreparedStatement parameters are incorrectly generated when tuple object substitution is used HOT 1
- java.lang.RuntimeException in SqlDelightGotoDeclarationHandler.kt:124
- Enable creation of a database interface with dependencies only, no .sq files
- Queries impacted by a trigger don't reemit
- PostgreSQL - ILIKE isn't supported HOT 1
- Support XML type in Postgresql
- Make it possible to insert raw SQL types to cast if I really know what I'm doing and SQLDelight does not HOT 1
- Add DATE and TIME Literals for Postgresql Dialect HOT 1
- java.lang.Exception in SqlDelightFindUsagesHandlerFactory.kt:85
- java.lang.Throwable in SqlDelightFileViewProviderFactory.kt:176
- java.util.NoSuchElementException in SqlInsertExcludedTableMixin.kt:27
- Gradle warning logged, ‘Changing log factory from null to null’ HOT 1
- postgresql: unable to specify table in SELECT DISTINCT ON (...)
- postgresql: unable to use `unnest(...)` in subquery
- postgresql: unable to use `OR EXISTS` in `WHERE` clause
- java.lang.NoSuchMethodError in MySqlTypeResolver.kt:150
- java.lang.NoSuchMethodError in MySqlTypeResolver.kt:135
- org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException in SqlDelightGotoDeclarationHandler.kt:124
- Cannot use `IF NOT EXISTS` when creating extensions HOT 1
- Testing for migrations to kmp
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 sqldelight.