{"id":16758396,"url":"https://github.com/kessler/websql-sugar","last_synced_at":"2025-04-10T17:13:19.063Z","repository":{"id":22932016,"uuid":"26281182","full_name":"kessler/websql-sugar","owner":"kessler","description":"something to make web sql sweeter","archived":false,"fork":false,"pushed_at":"2016-10-12T22:19:10.000Z","size":12,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T03:31:54.376Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kessler.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":"2014-11-06T17:24:30.000Z","updated_at":"2019-08-01T01:57:12.000Z","dependencies_parsed_at":"2022-08-21T16:50:33.415Z","dependency_job_id":null,"html_url":"https://github.com/kessler/websql-sugar","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fwebsql-sugar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fwebsql-sugar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fwebsql-sugar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fwebsql-sugar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/websql-sugar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261910,"owners_count":21074225,"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-10-13T04:05:09.028Z","updated_at":"2025-04-10T17:13:19.036Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# websql-sugar\n\nUse this to build data access layers on top of websql, e.g:\n\n```javascript\nvar db = require('websql-sugar')({ name: 'mydb', version: '1.1' })\n\nmodule.exports = {\n    listScans: function (cb) {\n        // readonly api\n        // select queries can be issued from newTx() too \n        // the singleSelectCallback will require the user of the result to write less boilerplate code\n        // and just handle the actual data\n        db.newRtx().query('SELECT * FROM scan').execute(db.singleSelectCallback(cb))\n    },\n\n    insertFoo: function (x, y, cb) {\n        db.newTx()\n            .query('INSERT INTO foo (x, y) VALUES (?, ?)',[x, y])\n            .execute(db.singleInsertCallback(cb))\n    },\n\n    updateScan: function (endTime, infected, id, cb) {\n        db.newTx()\n            // can just pass the arguments if they appear in the same order of the query parameters\n            .query('UPDATE scan SET end=?, infected=? WHERE id=?', arguments) \n            .execute(db.singleSelectCallback(cb))\n    }    \n}\n```\n\n### What's wrong with websql api?\n\n1. who designs properties that throws exceptions? printing objects is like walking in a mine field and that is exactly what happens in a websql query result!\n\n2. the callbacks are not in node.js convention :(\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fwebsql-sugar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Fwebsql-sugar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fwebsql-sugar/lists"}