8000 powersync-sqlite-core/README.md at v0.3.14 · powersync-ja/powersync-sqlite-core · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":".cargo","path":".cargo","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":"android","path":"android","contentType":"directory"},{"name":"crates","path":"crates","contentType":"directory"},{"name":"dart","path":"dart","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"sqlite-rs-embedded","path":"sqlite-rs-embedded","contentType":"submodule","submoduleUrl":"/powersync-ja/sqlite-rs-embedded/tree/5d35c2883d9889f01dee010223d94570c70039b7","submoduleDisplayName":"sqlite-rs-embedded @ 5d35c28"},{"name":"tool","path":"tool","contentType":"directory"},{"name":"wasm","path":"wasm","contentType":"directory"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".gitmodules","path":".gitmodules","contentType":"file"},{"name":"Cargo.lock","path":"Cargo.lock","contentType":"file"},{"name":"Cargo.toml","path":"Cargo.toml","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"NOTICE","path":"NOTICE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"RELEASING.md","path":"RELEASING.md","contentType":"file"},{"name":"UUID.md","path":"UUID.md","contentType":"file"},{"name":"powersync-sqlite-core.podspec","path":"powersync-sqlite-core.podspec","contentType":"file"},{"name":"rust-toolchain.toml","path":"rust-toolchain.toml","contentType":"file"}],"totalCount":21}},"fileTreeProcessingTime":20.031262,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":684622761,"defaultBranch":"main","name":"powersync-sqlite-core","ownerLogin":"powersync-ja","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-08-29T14:13:58.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/147553714?v=4","public":true,"private":false,"isOrgOwned":true},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"v0.3.14","listCacheKey":"v0:1749653629.0","canEdit":false,"refType":"tag","currentOid":"32384f76d7568c0639ba5b46d9eb5d5bbd913534"},"path":"README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/powersync-ja/powersync-sqlite-core/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/powersync-ja/powersync-sqlite-core/blob/v0.3.14/README.md?raw=true","headerInfo":{"blobSize":"1.45 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":null,"isGitLfs":false,"onBranch":false,"shortPath":"603d794","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fpowersync-ja%2Fpowersync-sqlite-core%2Fblob%2Fv0.3.14%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"PowerSync SQLite Extension","anchor":"powersync-sqlite-extension","htmlText":"PowerSync SQLite Extension"},{"level":1,"text":"API","anchor":"api","htmlText":"API"},{"level":1,"text":"Building and running","anchor":"building-and-running","htmlText":"Building and running"},{"level":1,"text":"Acknowledgements","anchor":"acknowledgements","htmlText":"Acknowledgements"}],"lineInfo":{"truncatedLoc":"58","truncatedSloc":"39"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/powersync-ja/powersync-sqlite-core/blob/v0.3.14/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/powersync-ja/powersync-sqlite-core/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/powersync-ja/powersync-sqlite-core/raw/refs/tags/v0.3.14/README.md","renderImageOrRaw":false,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePowerSync SQLite Extension\u003c/h1\u003e\u003ca id=\"user-content-powersync-sqlite-extension\" class=\"anchor\" aria-label=\"Permalink: PowerSync SQLite Extension\" href=\"#powersync-sqlite-extension\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis extension is used by PowerSync client SDKs.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe APIs here not currently stable, and may change in any release. The APIs are intended to be used by PowerSync SDKs only.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAPI\u003c/h1\u003e\u003ca id=\"user-content-api\" class=\"anchor\" aria-label=\"Permalink: API\" href=\"#api\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ePrimary APIs:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-sql notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"-- Load the extension\n-- Sets up functions and views, but does not touch the database itself.\n.load powersync\n\n-- Configure the schemas.\n-- Creates data tables, indexes and views.\nSELECT powersync_replace_schema('{\u0026quot;tables\u0026quot;: [{\u0026quot;name\u0026quot;: \u0026quot;test\u0026quot;, \u0026quot;columns\u0026quot;: [{\u0026quot;name\u0026quot;: \u0026quot;name\u0026quot;, \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;}]}]}');\n\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Load the extension\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Sets up functions and views, but does not touch the database itself.\u003c/span\u003e\n.load powersync\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Configure the schemas.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Creates data tables, indexes and views.\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e powersync_replace_schema(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e{\"tables\": [{\"name\": \"test\", \"columns\": [{\"name\": \"name\", \"type\": \"text\"}]}]}\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);\n\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOther APIs:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-sql notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"-- Initialize the extension data (creates internal tables).\n-- Optional - also called as part of powersync_replace_schema().\n-- Only useful to ensure internal tables are configured without touching the schema.\nSELECT powersync_init();\n\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Initialize the extension data (creates internal tables).\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Optional - also called as part of powersync_replace_schema().\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Only useful to ensure internal tables are configured without touching the schema.\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e powersync_init();\n\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBuilding and running\u003c/h1\u003e\u003ca id=\"user-content-building-and-running\" class=\"anchor\" aria-label=\"Permalink: Building and running\" href=\"#building-and-running\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eInitialize submodules recursively\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"git submodule update --init --recursive\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003egit submodule update --init --recursive\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Build the shell\ncargo build -p powersync_sqlite\n./target/debug/powersync_sqlite test.db \u0026quot;select powersync_rs_version()\u0026quot;\n\n# Build the loadable extension\ncargo build -p powersync_loadable\nsqlite3 \u0026quot;:memory:\u0026quot; \u0026quot;.load ./target/debug/libpowersync\u0026quot; \u0026quot;select powersync_rs_version()\u0026quot; #This requires sqlite3 installed\n\n# Build the release loadable extension\ncargo build -p powersync_loadable --release\n\n# Build for iOS\n./tool/build_xcframework.sh\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Build the shell\u003c/span\u003e\ncargo build -p powersync_sqlite\n./target/debug/powersync_sqlite test.db \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eselect powersync_rs_version()\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Build the loadable extension\u003c/span\u003e\ncargo build -p powersync_loadable\nsqlite3 \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e:memory:\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e.load ./target/debug/libpowersync\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eselect powersync_rs_version()\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003eThis requires sqlite3 installed\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Build the release loadable extension\u003c/span\u003e\ncargo build -p powersync_loadable --release\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Build for iOS\u003c/span\u003e\n./tool/build_xcframework.sh\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAcknowledgements\u003c/h1\u003e\u003ca id=\"user-content-acknowledgements\" class=\"anchor\" aria-label=\"Permalink: Acknowledgements\" href=\"#acknowledgements\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eStructure of the SQLite extension using Rust is inspired by \u003ca href=\"https://github.com/vlcn-io/cr-sqlite/\"\u003ecr-sqlite\u003c/a\u003e.\u003c/p\u003e\n\u003c/article\u003e","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/powersync-ja/powersync-sqlite-core/branches":{"post":"t2nHOR57FMhXfnkovI9deC53G04uxZyeob5X9Z3Lt07bcxXcN4j9ErM4UN-NbeD75Fx8oVdxzrjbE4XxHYY_dQ"},"/repos/preferences":{"post":"sQSe6zaWWI8Bhg54X-plaU5ovx4MalxiBCE-4soipn6m-zJ_RcBN7PhGn4O9Oa7yAzwU5yeQ8gIEJDySIcXdjg"}}},"title":"powersync-sqlite-core/README.md at v0.3.14 · powersync-ja/powersync-sqlite-core","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0