{"id":18544752,"url":"https://github.com/131/osqlite","last_synced_at":"2025-05-15T05:34:16.979Z","repository":{"id":57316615,"uuid":"190516548","full_name":"131/osqlite","owner":"131","description":"sqlite3 database on an object storage backed ","archived":false,"fork":false,"pushed_at":"2019-09-08T21:58:41.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T12:44:28.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/131.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":"2019-06-06T04:56:23.000Z","updated_at":"2022-11-11T21:06:23.000Z","dependencies_parsed_at":"2022-08-25T21:11:07.922Z","dependency_job_id":null,"html_url":"https://github.com/131/osqlite","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fosqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fosqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fosqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fosqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/131","download_url":"https://codeload.github.com/131/osqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254282977,"owners_count":22045131,"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":[],"created_at":"2024-11-06T20:17:30.085Z","updated_at":"2025-05-15T05:34:16.953Z","avatar_url":"https://github.com/131.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[osqlite](https://github.com/131/osqlite) gives you an [sqlite3](https://github.com/mapbox/node-sqlite3) database on an object storage backed (like [openstack swift](https://github.com/131/swift)).\n\n\n[![Build Status](https://travis-ci.org/131/osqlite.svg?branch=master)](https://travis-ci.org/131/osqlite)\n[![Coverage Status](https://coveralls.io/repos/github/131/osqlite/badge.svg?branch=master)](https://coveralls.io/github/131/osqlite?branch=master)\n[![Version](https://img.shields.io/npm/v/osqlite.svg)](https://www.npmjs.com/package/osqlite)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n[![Code style](https://img.shields.io/badge/code%2fstyle-ivs-green.svg)](https://www.npmjs.com/package/eslint-plugin-ivs)\n![Available platform](https://img.shields.io/badge/platform-win32-blue.svg)\n\n\n\n# Motivation\nObject storage is, by far, the cheapest cloud storage solution. If i want to store TB of contents, a [CAS designed](https://en.wikipedia.org/wiki/Content-addressable_storage) container is an excellent choice. But CAS relies on external database to handle file properties (name, directories \u0026 properties). [osqlite](https://github.com/131/osqlite) allows you to store your database in the very same object storage container your CAS relies on.\n\n[osqlite](https://github.com/131/osqlite) uses the SQLite3 \"hot\" [backup/replication API](https://sqlite.org/backup.html) to publish current database and register triggers on the [SQLite3 update hook API](https://www.sqlite.org/c3ref/update_hook.html) to know \"when\" to sync.\n\n# Usage example\n\n```\nconst OSQLite = require('osqlite');\n\nconst creds   = require('./credentials');\nconst Context = require('swift/context');\n\nvar ctx = await Context.build(creds);\nvar lnk = OSQLite.build({\n  backend   : {type : 'swift', ctx},\n  container : 'container',\n  filename  : 'index.sqlite',\n});\n\nawait lnk.query(\"CREATE TABLE  IF NOT EXISTS lorem (info TEXT)\");\n\nconsole.log(\"Database contains %d entries\", await lnk.value(\"SELECT COUNT(*) FROM lorem\"));\n\nfor(let var i=0;i\u003c10;i++) {\n  let message = \"foobar\" + Date.now();\n  console.log(\"Updating sqlite database\");\n  await lnk.insert(\"lorem\", {\"info\": message});\n  await sleep(200);\n}\n\n\nawait lnk.close();//flush all to remote endpoint\n\n```\n\n\n\n# Efficiency, triggers \u0026 throttle\n[osqlite](https://github.com/131/osqlite)  will trigger synchronisation (object storage write) after each update/delete/insert following [a cargo pattern](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966).\n\n\n\n\n\n\n# Credits \n* [131](https://github.com/131)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fosqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F131%2Fosqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fosqlite/lists"}