{"id":19273791,"url":"https://github.com/lzdyes/tauri-plugin-sqlite","last_synced_at":"2025-04-21T22:33:14.075Z","repository":{"id":41386584,"uuid":"489683325","full_name":"lzdyes/tauri-plugin-sqlite","owner":"lzdyes","description":"A Tauri plugin for interface to SQLite","archived":false,"fork":false,"pushed_at":"2022-07-11T02:31:47.000Z","size":27,"stargazers_count":102,"open_issues_count":10,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T16:24:02.281Z","etag":null,"topics":["database","rust","sqlite","tauri","tauri-plugin","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lzdyes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-07T13:38:02.000Z","updated_at":"2025-02-11T21:35:34.000Z","dependencies_parsed_at":"2022-08-10T02:07:08.673Z","dependency_job_id":null,"html_url":"https://github.com/lzdyes/tauri-plugin-sqlite","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzdyes%2Ftauri-plugin-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzdyes%2Ftauri-plugin-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzdyes%2Ftauri-plugin-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzdyes%2Ftauri-plugin-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzdyes","download_url":"https://codeload.github.com/lzdyes/tauri-plugin-sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250145123,"owners_count":21382352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","rust","sqlite","tauri","tauri-plugin","typescript"],"created_at":"2024-11-09T20:44:07.217Z","updated_at":"2025-04-21T22:33:09.060Z","avatar_url":"https://github.com/lzdyes.png","language":"Rust","readme":"# Tauri Plugin SQLite\n\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis plugin provides a \"classical\" Tauri Plugin interface to SQLite database through [sqlite](https://github.com/stainless-steel/sqlite).\n\n## Installation\n\n### Rust\n\n`src-tauri/Cargo.toml`\n\n```toml\n[dependencies.tauri-plugin-sqlite]\ngit = \"https://github.com/lzdyes/tauri-plugin-sqlite\"\ntag = \"v0.1.1\"\n```\n\n### Webview\n\n```\nnpm install github:lzdyes/tauri-plugin-sqlite#v0.1.1\n# or\nyarn add github:lzdyes/tauri-plugin-sqlite#v0.1.1\n```\n\n## Usage\n\n### Rust\n\n`src-tauri/src/main.rs`\n\n```rust\nfn main() {\n    tauri::Builder::default()\n        .plugin(tauri_plugin_sqlite::init())\n        .build()\n        .run();\n}\n```\n\n### JavaScript/TypeScript\n\n```ts\nimport SQLite from 'tauri-plugin-sqlite-api'\n\n/** The path will be 'src-tauri/test.db', you can customize the path */\nconst db = await SQLite.open('./test.db')\n\n/** execute SQL */\nawait db.execute(`\n    CREATE TABLE users (name TEXT, age INTEGER);\n    INSERT INTO users VALUES ('Alice', 42);\n    INSERT INTO users VALUES ('Bob', 69);\n`)\n\n/** execute SQL with params */\nawait db.execute('INSERT INTO users VALUES (?1, ?2)', ['Jack', 18])\n\n/** batch execution SQL with params */\nawait db.execute('INSERT INTO users VALUES (?1, ?2)', [\n  ['Allen', 20],\n  ['Barry', 16],\n  ['Cara', 28],\n])\n\n/** select count */\nconst rows = await db.select\u003cArray\u003c{ count: number }\u003e\u003e('SELECT COUNT(*) as count FROM users')\n\n/** select with param */\nconst rows = await db.select\u003cArray\u003c{ name: string }\u003e\u003e('SELECT name FROM users WHERE age \u003e ?', [20])\n\n/** select with params, you can use ? or $1 .. $n */\nconst rows = await db.select\u003cArray\u003cany\u003e\u003e('SELECT * FROM users LIMIT $1 OFFSET $2', [10, 0])\n\n/** close sqlite database */\nconst isClosed = await db.close()\n```\n\n## Contribute\n\nContributions are welcome! please open issues and pull request :)\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzdyes%2Ftauri-plugin-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzdyes%2Ftauri-plugin-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzdyes%2Ftauri-plugin-sqlite/lists"}