Custom SQL functions, schema builder, CI, and cross-platform build support - #2
Merged
Merged
Conversation
Mirrors colemancda/junkbot-swift's swift-windows.yml pattern: installs the toolchain via compnerd/gha-setup-swift, then builds and tests.
sqlite3_db_filename() returns the OS-native path, which on Windows uses backslashes, while Bundle.module.path(forResource:) returns a forward-slash path. Normalize before comparing so these tests pass on Windows too.
/tmp isn't a valid path on Windows, so opening a read-write connection there fails at connection time (SQLITE_CANTOPEN) rather than exercising the intended statement-prepare failure the tests were checking for.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Connection.createFunction/createAggregateFunction/createWindowFunction/createCollation(and matching removal methods), wrappingsqlite3_create_function_v2,sqlite3_create_window_function, andsqlite3_create_collation_v2for scalar, aggregate, window, and collation SQL extensions.Connection.run/scalar/transaction, aPreparedStatementcursor (prepare,failableNext,rowDictionaries), aBlobconvenience type, and a minimalSchemaChanger/ColumnDefinitionDDL builder (CREATE TABLE, primary key, foreign key, unique, default, nullable).Connection.init(path:isReadOnly:), which never forwardedisReadOnlytosqlite3_open_v2, and a related crash readingfilenameon connections with no backing file (e.g.:memory:).PureSwift/swift-sqlcipherfor the C SQLite implementation on non-Darwin platforms (Linux, Android, Windows, WASI, OpenBSD); Darwin keeps linking the systemSQLite3framework.FoundationEssentialsover fullFoundationwhere sufficient (Data,UUID,Date,URLComponents), falling back toFoundationonly where needed (ISO8601DateFormatter).SWIFT_BUILD_DYNAMIC_LIBRARY, for Skip Tools interop.macos-26), Linux (swift:6.3.3container), and Android (viaskiptools/swift-android-action) jobs, running on every push.stephencelis/SQLite.swift's suite adapted to this package's API, plus new tests covering aggregate/window/collation functions.Test plan
swift build/swift teston macOS — all tests pass.swift build/swift testunderdocker run swift:6.3.3— all tests pass, including theswift-sqlcipherdependency andFoundationEssentialsimports.