sql-kit
sql-kit copied to clipboard
*️⃣ Build SQL queries in Swift. Extensible, protocol-based design that supports DQL, DML, and DDL.
This adds functionality to do a multi-row inserts with a single `values` method call. Previously, to insert multiple rows a user had to call `values` repeatedly: ```swift db.insert(into: "planets") .columns(["name",...
What the true way to use transaction with async/await style? Any examples?
Is there a way to write strongly typed queries? For example, instead of: ``` db.select() .column("size") .from("planets") .where("name", .equal, "Earth") ``` I would like to write something like this: ```...
Should be just a case of copying the appropriate conformances and constraints for joins from the select builder to the update builder and making sure the serialization knows to apply...
Code snippet ``` try self.db.create(table: "galaxies") .column("id", type: .int, .primaryKey) .column("name", type: .text) .run().wait() ``` Generates SQL as `CREATE TABLE "galaxies"("id" INTEGER PRIMARY KEY DEFAULT UNIQUE, "name" TEXT) ` The...
@tanner0101 , after out long chat on Discord, I ended up with these convenience methods. Like you said, they only work if all arguments are the same for the groupBy...
**Is your feature request related to a problem? Please describe.** Some time I'd like to know how many rows changed after UPDATE statement executed, to control parallel access. e.g. SELECT...
https://github.com/vapor/sql-kit/blob/f7bbbb022cb52e1828a137bcab2bd1ea2a3e583d/Sources/SQLKit/Builders/SQLColumnUpdateBuilder.swift#L14-L16 `.set(model:)` does not provide a way to specify `SQLQueryEncoder` options. This will be in trouble when dealing with simple Codable types (that is not Fluent type)and have optional properties....
### Problem Description When trying to decode a query that has a JSON column with booleans and/or date values, it fails with an error. Consider the following minimal example: ```swift...
When inserting, you can specify a keyEncodingStrategy: ``` try db.insert(into: myTable) .model(myModel, keyEncodingStrategy: .convertToSnakeCase) .run() ``` This change allows to pass a keyDecodingStrategy when using the convenience methods to decode...