[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6709":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},6709,"SQLite.swift","stephencelis\u002FSQLite.swift","stephencelis","A type-safe, Swift-language layer over SQLite3.","",null,"Swift",10163,1617,212,134,0,1,3,24,5,75.53,"MIT License",false,"master",true,[27,28],"sqlite","swift","2026-06-12 04:00:30","# SQLite.swift\n\n![Build Status][GitHubActionBadge] [![CocoaPods Version][CocoaPodsVersionBadge]][CocoaPodsVersionLink] [![Swift5 compatible][Swift5Badge]][Swift5Link] [![Platform][PlatformBadge]][PlatformLink] [![Carthage compatible][CartagheBadge]][CarthageLink] [![Join the chat at https:\u002F\u002Fgitter.im\u002Fstephencelis\u002FSQLite.swift][GitterBadge]][GitterLink]\n\nA type-safe, [Swift][]-language layer over [SQLite3][].\n\n[SQLite.swift][] provides compile-time confidence in SQL statement\nsyntax _and_ intent.\n\n## Features\n\n - A pure-Swift interface\n - A type-safe, optional-aware SQL expression builder\n - A flexible, chainable, lazy-executing query layer\n - Automatically-typed data access\n - A lightweight, uncomplicated query and parameter binding interface\n - Developer-friendly error handling and debugging\n - [Full-text search][] support\n - [Well-documented][See Documentation]\n - Extensively tested\n - [SQLCipher][] support via Swift Package Manager\n - [Schema query\u002Fmigration][]\n - First-class WAL mode and journaling configuration via\n   `Connection(_, journalMode: .wal)` and the `enableWAL()` \u002F `walCheckpoint(...)`\n   APIs\n - Works on [Linux](Documentation\u002FLinux.md) (with some limitations)\n - Active support at\n   [StackOverflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fsqlite.swift),\n   and [Gitter Chat Room](https:\u002F\u002Fgitter.im\u002Fstephencelis\u002FSQLite.swift)\n   (_experimental_)\n\n[SQLCipher]: https:\u002F\u002Fwww.zetetic.net\u002Fsqlcipher\u002F\n[Full-text search]: Documentation\u002FIndex.md#full-text-search\n[Schema query\u002Fmigration]: Documentation\u002FIndex.md#querying-the-schema\n[See Documentation]: Documentation\u002FIndex.md#sqliteswift-documentation\n\n\n## Usage\n\n```swift\nimport SQLite\n\n\u002F\u002F Wrap everything in a do...catch to handle errors\ndo {\n    let db = try Connection(\"path\u002Fto\u002Fdb.sqlite3\")\n\n    let users = Table(\"users\")\n    let id = SQLite.Expression\u003CInt64>(\"id\")\n    let name = SQLite.Expression\u003CString?>(\"name\")\n    let email = SQLite.Expression\u003CString>(\"email\")\n\n    try db.run(users.create { t in\n        t.column(id, primaryKey: true)\n        t.column(name)\n        t.column(email, unique: true)\n    })\n    \u002F\u002F CREATE TABLE \"users\" (\n    \u002F\u002F     \"id\" INTEGER PRIMARY KEY NOT NULL,\n    \u002F\u002F     \"name\" TEXT,\n    \u002F\u002F     \"email\" TEXT NOT NULL UNIQUE\n    \u002F\u002F )\n\n    let insert = users.insert(name \u003C- \"Alice\", email \u003C- \"alice@mac.com\")\n    let rowid = try db.run(insert)\n    \u002F\u002F INSERT INTO \"users\" (\"name\", \"email\") VALUES ('Alice', 'alice@mac.com')\n\n    for user in try db.prepare(users) {\n        print(\"id: \\(user[id]), name: \\(user[name]), email: \\(user[email])\")\n        \u002F\u002F id: 1, name: Optional(\"Alice\"), email: alice@mac.com\n    }\n    \u002F\u002F SELECT * FROM \"users\"\n\n    let alice = users.filter(id == rowid)\n\n    try db.run(alice.update(email \u003C- email.replace(\"mac.com\", with: \"me.com\")))\n    \u002F\u002F UPDATE \"users\" SET \"email\" = replace(\"email\", 'mac.com', 'me.com')\n    \u002F\u002F WHERE (\"id\" = 1)\n\n    try db.run(alice.delete())\n    \u002F\u002F DELETE FROM \"users\" WHERE (\"id\" = 1)\n\n    try db.scalar(users.count) \u002F\u002F 0\n    \u002F\u002F SELECT count(*) FROM \"users\"\n} catch {\n    print (error)\n}\n```\n\nNote that `Expression` should be written as `SQLite.Expression` to avoid\nconflicts with the `SwiftUI.Expression` if you are using SwiftUI too.\n\nSQLite.swift also works as a lightweight, Swift-friendly wrapper over the C\nAPI.\n\n```swift\n\u002F\u002F Wrap everything in a do...catch to handle errors\ndo {\n    \u002F\u002F ...\n\n    let stmt = try db.prepare(\"INSERT INTO users (email) VALUES (?)\")\n    for email in [\"betty@icloud.com\", \"cathy@icloud.com\"] {\n        try stmt.run(email)\n    }\n\n    db.totalChanges    \u002F\u002F 3\n    db.changes         \u002F\u002F 1\n    db.lastInsertRowid \u002F\u002F 3\n\n    for row in try db.prepare(\"SELECT id, email FROM users\") {\n        print(\"id: \\(row[0]), email: \\(row[1])\")\n        \u002F\u002F id: Optional(2), email: Optional(\"betty@icloud.com\")\n        \u002F\u002F id: Optional(3), email: Optional(\"cathy@icloud.com\")\n    }\n\n    try db.scalar(\"SELECT count(*) FROM users\") \u002F\u002F 2\n} catch {\n    print (error)\n}\n```\n\n[Read the documentation][See Documentation] or explore more,\ninteractively, from the Xcode project’s playground.\n\n![SQLite.playground Screen Shot](Documentation\u002FResources\u002Fplayground@2x.png)\n\n## Installation\n\n### Swift Package Manager\n\nThe [Swift Package Manager][] is a tool for managing the distribution of\nSwift code.\n\n1. Add the following to your `Package.swift` file:\n\n  ```swift\n  dependencies: [\n      .package(url: \"https:\u002F\u002Fgithub.com\u002Fstephencelis\u002FSQLite.swift.git\", from: \"0.16.0\")\n  ]\n  ```\n\n2. Build your project:\n\n  ```sh\n  $ swift build\n  ```\n\nSee the [Tests\u002FSPM](https:\u002F\u002Fgithub.com\u002Fstephencelis\u002FSQLite.swift\u002Ftree\u002Fmaster\u002FTests\u002FSPM) folder for a small demo project which uses SPM.\n\n[Swift Package Manager]: https:\u002F\u002Fswift.org\u002Fpackage-manager\n\n### Carthage\n\n[Carthage][] is a simple, decentralized dependency manager for Cocoa. To\ninstall SQLite.swift with Carthage:\n\n 1. Make sure Carthage is [installed][Carthage Installation].\n\n 2. Update your Cartfile to include the following:\n\n    ```ruby\n    github \"stephencelis\u002FSQLite.swift\" ~> 0.16.0\n    ```\n\n 3. Run `carthage update` and\n    [add the appropriate framework][Carthage Usage].\n\n\n[Carthage]: https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage\n[Carthage Installation]: https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage#installing-carthage\n[Carthage Usage]: https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage#adding-frameworks-to-an-application\n\n\n### CocoaPods\n\n[CocoaPods][] is a dependency manager for Cocoa projects. To install\nSQLite.swift with CocoaPods:\n\n 1. Make sure CocoaPods is [installed][CocoaPods Installation].\n\n    ```sh\n    # Using the default Ruby install will require you to use sudo when\n    # installing and updating gems.\n    [sudo] gem install cocoapods\n    ```\n\n 2. Update your Podfile to include the following:\n\n    ```ruby\n    use_frameworks!\n\n    target 'YourAppTargetName' do\n        pod 'SQLite.swift', '~> 0.15.0'\n    end\n    ```\n\n 3. Run `pod install --repo-update`.\n\n[CocoaPods]: https:\u002F\u002Fcocoapods.org\n[CocoaPods Installation]: https:\u002F\u002Fguides.cocoapods.org\u002Fusing\u002Fgetting-started.html#getting-started\n\n### Manual\n\nTo install SQLite.swift as an Xcode sub-project:\n\n 1. Drag the **SQLite.xcodeproj** file into your own project.\n    ([Submodule][], clone, or [download][] the project first.)\n\n    ![Installation Screen Shot](Documentation\u002FResources\u002Finstallation@2x.png)\n\n 2. In your target’s **General** tab, click the **+** button under **Linked\n    Frameworks and Libraries**.\n\n 3. Select the appropriate **SQLite.framework** for your platform.\n\n 4. **Add**.\n\nSome additional steps are required to install the application on an actual\ndevice:\n\n 5. In the **General** tab, click the **+** button under **Embedded\n    Binaries**.\n\n 6. Select the appropriate **SQLite.framework** for your platform.\n\n 7. **Add**.\n\n\n[Xcode]: https:\u002F\u002Fdeveloper.apple.com\u002Fxcode\u002Fdownloads\u002F\n[Submodule]: https:\u002F\u002Fgit-scm.com\u002Fbook\u002Fen\u002FGit-Tools-Submodules\n[download]: https:\u002F\u002Fgithub.com\u002Fstephencelis\u002FSQLite.swift\u002Farchive\u002Fmaster.zip\n\n\n## Communication\n\n[Read the contributing guidelines][]. The _TL;DR_ (but please; _R_):\n\n - Need **help** or have a **general question**? [Ask on Stack\n   Overflow][] (tag `sqlite.swift`).\n - Found a **bug** or have a **feature request**? [Open an issue][].\n - Want to **contribute**? [Submit a pull request][].\n\n[Read the contributing guidelines]: .\u002FCONTRIBUTING.md#contributing\n[Ask on Stack Overflow]: https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fsqlite.swift\n[Open an issue]: https:\u002F\u002Fgithub.com\u002Fstephencelis\u002FSQLite.swift\u002Fissues\u002Fnew\n[Submit a pull request]: https:\u002F\u002Fgithub.com\u002Fstephencelis\u002FSQLite.swift\u002Ffork\n\n\n## Original author\n\n - [Stephen Celis](mailto:stephen@stephencelis.com)\n   ([@stephencelis](https:\u002F\u002Ftwitter.com\u002Fstephencelis))\n\n\n## License\n\nSQLite.swift is available under the MIT license. See [the LICENSE\nfile](.\u002FLICENSE.txt) for more information.\n\n## Related\n\nThese projects enhance or use SQLite.swift:\n\n - [SQLiteMigrationManager.swift][] (inspired by\n   [FMDBMigrationManager][])\n\n## Alternatives\n\nLooking for something else? Try another Swift wrapper (or [FMDB][]):\n\n - [GRDB](https:\u002F\u002Fgithub.com\u002Fgroue\u002FGRDB.swift)\n - [SQLiteDB](https:\u002F\u002Fgithub.com\u002FFahimF\u002FSQLiteDB)\n\n[Swift]: https:\u002F\u002Fswift.org\u002F\n[SQLite3]: https:\u002F\u002Fwww.sqlite.org\n[SQLite.swift]: https:\u002F\u002Fgithub.com\u002Fstephencelis\u002FSQLite.swift\n\n[GitHubActionBadge]: https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fstephencelis\u002FSQLite.swift\u002Fbuild.yml?branch=master\n\n[CocoaPodsVersionBadge]: https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FSQLite.swift.svg?style=flat\n[CocoaPodsVersionLink]: https:\u002F\u002Fcocoapods.org\u002Fpods\u002FSQLite.swift\n\n[PlatformBadge]: https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FSQLite.swift.svg?style=flat\n[PlatformLink]: https:\u002F\u002Fcocoapods.org\u002Fpods\u002FSQLite.swift\n\n[CartagheBadge]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat\n[CarthageLink]: https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage\n\n[GitterBadge]: https:\u002F\u002Fbadges.gitter.im\u002Fstephencelis\u002FSQLite.swift.svg\n[GitterLink]: https:\u002F\u002Fgitter.im\u002Fstephencelis\u002FSQLite.swift\n\n[Swift5Badge]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fswift-5-orange.svg?style=flat\n[Swift5Link]: https:\u002F\u002Fdeveloper.apple.com\u002Fswift\u002F\n\n[SQLiteMigrationManager.swift]: https:\u002F\u002Fgithub.com\u002Fgarriguv\u002FSQLiteMigrationManager.swift\n[FMDB]: https:\u002F\u002Fgithub.com\u002Fccgus\u002Ffmdb\n[FMDBMigrationManager]: https:\u002F\u002Fgithub.com\u002Flayerhq\u002FFMDBMigrationManager\n","SQLite.swift 是一个为 SQLite3 提供类型安全的 Swift 语言层。它提供了一个纯 Swift 接口，支持类型安全和可选感知的 SQL 表达式构建器，以及灵活、链式且延迟执行的查询层。该项目还具备自动类型数据访问、轻量级参数绑定接口、友好的错误处理与调试功能，并支持全文搜索和 SQLCipher 加密。适用于需要在 Swift 项目中进行数据库操作的场景，尤其是在对 SQL 语法正确性和意图有高要求的情况下。其文档详尽且经过广泛测试，同时支持 Linux 平台（部分受限）。",2,"2026-06-11 03:08:29","top_language"]