Commit Graph
48 Commits
Author SHA1 Message Date
Gwendal Roué 7bd1992e61 Fix ergonomics issue with the definition of compound primary key
If the user would forget the PrimaryKeyDefinition, the primary was not defined:

try db.create(table: "membership") { t in
    // WRONG: pk is unused
    t.primaryKey { pk in
        t.column("playerId", .integer)
        t.column("teamId", .text)
    }
}

The fix is to remove the PrimaryKeyDefinition:

try db.create(table: "membership") { t in
    t.primaryKey {
        t.column("playerId", .integer)
        t.column("teamId", .text)
    }
}
2022-11-27 14:09:25 +01:00
Gwendal Roué f8728bbed8 Enhance documentation 2022-11-27 13:01:42 +01:00
Gwendal Roué f5ebf0de4d Use primary key definitions with NOT NULL constraint by default 2022-11-27 12:35:47 +01:00
Gwendal Roué cd16e921fe Tests for primary key definition with NOT NULL constraint by default 2022-11-27 11:47:56 +01:00
Gwendal Roué 8b8e480391 Primary key definition with NOT NULL constraint by default 2022-11-27 11:32:38 +01:00
Gwendal Roué 3074b61cb7 Move schema documentation to DocC 2022-11-27 11:07:13 +01:00
Gwendal Roué 4e4699ebed Improve inline documentation 2022-11-26 16:26:46 +01:00
Gwendal Roué b14ef2112c Fix documentation typo 2022-11-11 12:55:35 +01:00
Gwendal Roué 13c804d1cc DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 2ade133b50 Move availability check below doc comment 2022-10-20 08:27:46 +02:00
Josip Cavar c57e76be52 Add support for .strict table option in 3.37+ 2022-10-19 15:55:46 +02:00
Gwendal Roué c553d2d69e Documentation 2022-08-21 21:22:34 +02:00
Gwendal Roué a9fcf1b9c1 SE-0335, SE-0341, SE-0346, SE-0352, SE-0358: some, any, primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué fe225fe452 BREAKING: Remove deprecated methods 2022-08-21 19:21:57 +02:00
Timothy Ellis daf44d9baa Exposed drop(column:) to custom builds and cipher 2022-01-18 10:11:12 +11:00
Timothy Ellis 869d776962 Added drop column support 2022-01-17 10:02:04 +11:00
Gwendal Roué 95f1d83d78 The .strict table creation option
The .strict table creation option

The .strict table creation option
2022-01-09 17:01:37 +01:00
Gwendal Roué 8217966215 Table creation methods accept throwing closures 2021-12-21 09:26:55 +01:00
Thomas Walther 48f6cee7a6 Fix docstring for Database.create(index: ...) 2021-12-07 13:20:14 +01:00
Zev Eisenberg 8b060e6b09 Add angle brackets to URLs to make them clickable in Xcode's rendered documentation. 2021-07-20 20:53:58 -04:00
Gwendal Roué 1a2de126ce Fix #988 2021-06-17 19:30:03 +02:00
Gwendal Roué 051fdb37b6 Rename SQLLiteral to SQL 2021-03-21 13:33:49 +01:00
Gwendal Roué 339fbdf1ce Literal column alteration 2021-03-17 21:54:56 +01:00
Gwendal Roué 085c8f5953 Literal table and constraint definition 2021-03-17 20:26:49 +01:00
Gwendal Roué 836efb120f Xcode 12.3 formatting 2020-12-23 12:13:05 +01:00
Gwendal Roué b8dd2ce2f4 Generate columns from query interface expressions
This allows to avoid SQL injection
2020-10-31 14:16:04 +01:00
Gwendal Roué 57036c4470 Use SQLite ergonomics, and create virtual generated columns by default 2020-10-31 13:55:07 +01:00
Michael Allman 3318858b80 Wrap the generatedAs column definition API with the GRDBCUSTOMSQLITE
Swift compiler flag
2020-10-25 11:44:09 -07:00
Michael Allman 071bbc7905 Initial commit for generated column support 2020-10-19 21:25:36 -07:00
Gwendal Roué f62b952d70 Fix failing test for #838 2020-09-19 13:11:44 +02:00
Gwendal Roué 519410fc3a Fix availability 2020-07-12 12:03:46 +02:00
Gwendal Roué df92e350c0 Documentation 2020-07-11 20:29:47 +02:00
Gwendal Roué 90e7449d6a Documentation 2020-07-11 19:21:33 +02:00
Gwendal Roué 84ca69d27c Value quoting can now require a database connection 2020-04-29 11:03:51 +02:00
Gwendal Roué 27120643b9 SE-0255: Implicit returns from single-expression functions 2020-04-09 17:16:23 +02:00
Gwendal Roué 7865b0a2ee SE-0249: Key Path Expressions as Functions 2020-03-08 19:58:51 +01:00
Gwendal Roué 00b0dc2a04 Remove availability checks for macOS 10.10 (forgotten in #719) 2020-03-08 19:08:15 +01:00
Gwendal Roué cdda2852d3 Merge branch 'development' into dev/qualifiedSQLLiteral 2020-02-14 11:43:15 +01:00
Gwendal Roué 1f4b374bce Documentation for #689 2020-02-14 11:40:17 +01:00
gjeck d14ac3e8d3 Resolve test issues with SQLCipher
Note: SQLCipher3 will have the new column rename method exposed, but it
will throw an error at runtime if used.
2020-01-24 09:22:43 -08:00
gjeck 09087bdbf9 Adjust available checks 2020-01-24 08:46:55 -08:00
gjeck 538252a4bf Allow column rename on custom sqlite target 2020-01-24 08:46:55 -08:00
gjeck 371e8f0dbe Add support for renaming columns within a table
SQLite introduced enhancements to the `ALTER TABLE` command in 3.25.0.
iOS 13.0+, macOS 10.15+, tvOS 13.0+, and watchOS 6.0+ have a SQLite
library bundled higher than 3.25.0.

For more information see https://www.sqlite.org/lang_altertable.html
2020-01-24 08:46:55 -08:00
Gwendal Roué 5e67ca5566 Deprecate SQLExpressionLiteral, hide SQLSelectionLiteral, introduce SQLLiteral.sqlExpression and .sqlSelectable 2020-01-24 08:55:55 +01:00
Gwendal Roué df6bb8761c Swiftlint + whitespace 2019-07-01 08:57:53 +02:00
Gwendal Roué ab000d7a4f Remove useless expression parenthesis from SQL 2019-05-26 20:08:13 +02:00
Gwendal Roué faae864699 Query Interface code organization 2019-05-22 20:13:33 +02:00