{"id":24716755,"url":"https://github.com/baylorrae/client-side-db","last_synced_at":"2026-05-11T03:20:31.603Z","repository":{"id":137876161,"uuid":"995704","full_name":"BaylorRae/Client-Side-DB","owner":"BaylorRae","description":"Client Side DB is a wrapper for the Web SQL Database that makes it easy to, make a database, create a table, insert rows, get rows, and run queries.","archived":false,"fork":false,"pushed_at":"2010-10-19T00:46:24.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T09:14:04.192Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaylorRae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-10-17T22:55:39.000Z","updated_at":"2013-05-07T11:15:26.000Z","dependencies_parsed_at":"2023-04-25T19:02:32.566Z","dependency_job_id":null,"html_url":"https://github.com/BaylorRae/Client-Side-DB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FClient-Side-DB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FClient-Side-DB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FClient-Side-DB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FClient-Side-DB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaylorRae","download_url":"https://codeload.github.com/BaylorRae/Client-Side-DB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244932953,"owners_count":20534263,"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":"2025-01-27T09:14:06.771Z","updated_at":"2026-05-11T03:20:31.565Z","avatar_url":"https://github.com/BaylorRae.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Client Side DB\nClient Side DB is a wrapper for the [Web SQL Database](http://dev.w3.org/html5/webdatabase/) that makes it easy to add a database, create a table, insert rows, get rows, and run queries.\n\n### The Basics\n\n\t/**\n\t * Create the database\n\t *\n\t * @param Name (required)\n\t * @param Version (required)\n\t * @param Description (required)\n\t * @param Estimated Size (optional)\n\t*/\n\tvar db = new ClientSideDB('Database Name', '1.0', 'This is my database');\n\t\n\t// Make sure the database is available (supported by the browser)\n\tif( db.isAvailable ) {\n\t\t\n\t\t/**\n\t\t * Create the table\n\t\t *\n\t\t * @param Name (required)\n\t\t * @param Fields (required)(array)\n\t\t*/\n\t\tdb.createTable('users', ['id INTEGER PRIMARY KEY AUTOINCREMENT', 'name', 'email']);\n\t\t\n\t\t/**\n\t\t * Insert our first row\n\t\t *\n\t\t * @param Table (required)\n\t\t * @param Values (required)(object)\n\t\t *\n\t\t * @note We don't have to supply the id because we set it to be auto incremental\n\t\t*/\n\t\tdb.insert('users', {\n\t\t\tname: 'Baylor',\n\t\t\temail: 'baylor@example.com'\n\t\t});\n\t\t\n\t\t/**\n\t\t * Update row. Set the name to \"Baylor Rae'\"\n\t\t * Where the id = 1 and name = 'Baylor'\n\t\t *\n\t\t * @param Table (required)\n\t\t * @param Values (required)(object)\n\t\t * @param Where (required)(object)\n\t\t * @param Success function (optional)\n\t\t * @param Error function (optional)\n\t\t*/\n\t\tdb.update('users', {\n\t\t\t// What to update\n\t\t\tname: \"Baylor Rae'\"\n\t\t}, {\n\t\t\t// Where to update it\n\t\t\tid: 1,\n\t\t\tname: 'Baylor'\n\t\t}, function() {\n\t\t\talert('User #1 has been updated');\n\t\t});\n\t\t\n\t\t/**\n\t\t * Get rows from the database\n\t\t *\n\t\t * @param Table (required)\n\t\t * @param Columns (optional)(array) (default: *)\n\t\t * @param Success function (optional)\n\t\t * @param Error function (optional)\n\t\t*/\n\t\tdb.get('users', ['name', 'email'], function(tx, results) {\n\t\t\t\n\t\t\t// Loop through the results\n\t\t\tfor( var i = 0, len = results.rows.length; i \u003c len; i++ ) {\n\t\t\t\t\n\t\t\t\t// Get the current result\n\t\t\t\tvar row = results.rows.item(i);\n\t\t\t\t\n\t\t\t\t// Log the name and email address\n\t\t\t\tconsole.log(row.name, row.email);\n\t\t\t}\n\t\t});\n\t\t\n\t\t/**\n\t\t * Run a raw query\n\t\t *\n\t\t * @param Query (required)\n\t\t * @param Args (required)(array)\n\t\t * @param Success function (optional)\n\t\t * @param Error function (optional)\n\t\t*/\n\t\tdb.query('DROP TABLE users', [], function() {\n\t\t\talert('Dropped the table users');\n\t\t});\n\t}\n\t\n### Notes\nI'm not a great javascript developer, so this wrapper probably has a lot of inefficient code. And if you see something that can be improved, please let me know. Also, [Web SQL Database](http://dev.w3.org/html5/webdatabase/) is based on [SQLite](http://www.sqlite.org/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaylorrae%2Fclient-side-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaylorrae%2Fclient-side-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaylorrae%2Fclient-side-db/lists"}