Closed finestructure closed 1 year ago
The config used was the default config:
❯ swift run sqlite2swift Lighter.json Foo ~/Downloads/chinook.db ~/Downloads/Chinook.swift
Building for debugging...
[80/80] Linking sqlite2swift
Build complete! (3.93s)
❯ cat Lighter.json
{
"__doc__": "Configuration used for the manual, builtin codegen.",
"databaseExtensions" : [ "sqlite3", "db", "sqlite" ],
"sqlExtensions" : [ "sql" ],
"CodeStyle": {
"functionCommentStyle" : "**",
"indent" : " ",
"lineLength" : 80
},
"EmbeddedLighter": {
"selects": {
"syncYield" : "none",
"syncArray" : { "columns": 6, "sorts": 2 },
"asyncArray" : { "columns": 6, "sorts": 2 }
},
"updates": {
"keyBased" : 6,
"predicateBased" : 6
},
"inserts": 6
}
}
Hm, looks like newline detection stopped working. Maybe the DB has CRs only? Will check.
That's a nice one! Unicode compose issue for \r\n:
if value.contains("\n") { // meh
"\n" doesn't match.
Fixed
I ran
sqlite2swift
against the chinook db with Lighter 1.0.26 and Swift 5.9 (Xcode 15.0) and it produced the following Swift code:Changing it to
for all the tables gets it to compile.