{"id":16382928,"url":"https://github.com/dresende/node-sqlaudit","last_synced_at":"2026-02-14T08:32:14.470Z","repository":{"id":38246235,"uuid":"167948579","full_name":"dresende/node-sqlaudit","owner":"dresende","description":"NodeJS SQL Audit language","archived":false,"fork":false,"pushed_at":"2024-12-07T15:12:00.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T12:31:39.455Z","etag":null,"topics":["audit","nodejs","sql"],"latest_commit_sha":null,"homepage":null,"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/dresende.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-28T11:08:46.000Z","updated_at":"2022-06-08T08:22:06.000Z","dependencies_parsed_at":"2025-04-13T12:07:26.164Z","dependency_job_id":"46953e31-2c9a-4984-9fe6-60a72f17b55f","html_url":"https://github.com/dresende/node-sqlaudit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dresende/node-sqlaudit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dresende%2Fnode-sqlaudit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dresende%2Fnode-sqlaudit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dresende%2Fnode-sqlaudit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dresende%2Fnode-sqlaudit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dresende","download_url":"https://codeload.github.com/dresende/node-sqlaudit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dresende%2Fnode-sqlaudit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29440370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["audit","nodejs","sql"],"created_at":"2024-10-11T04:06:51.907Z","updated_at":"2026-02-14T08:32:14.454Z","avatar_url":"https://github.com/dresende.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## NodeJS SQL Audit\n\nThis is a module that accepts a specific language that you can use to simplify\nauditing of SQL data.\n\n## Example\n\n```js\nconst sqlaudit = require(\"sqlaudit\");\nconst audit    = new sqlaudit({\n\tdb : \"mysql://user:password@host/database\",\n});\n\n// there's also an audit.runFile(filename, next)\naudit.runCode(`\n\tfor users[age \u003c 18] {\n\t\t// users under age must have no logins\n\t\ttotal_logins = 0\n\t\ttotal_logins = user_logins[user_id = id].count()\n\t}\n`, (err, result) =\u003e {\n\tif (err) throw err;\n\n\tconsole.log(result);\n});\n```\n\n## Language\n\n### Query\n\nA query is the most important component of the language. It is strongly based on CSS\nquery syntax.\n\n```js\ntable[prop1 \u003e value1, prop2 != value2].sum(value3)\n```\n\nThis basically selects from table `table` based on those 2 conditions (`prop1` and\n`prop2`) and agregates using `SUM()` based on `value3`.\n\nIn this specific case, we're selecting a single value. You can also select a row.\n\n```js\ntable[prop1 = value]:order(-prop2):first()\n```\n\nThis selects from table `table` order descending (that's what the minus sign is for)\nby `prop2` and returns the first row (this is the same as `:limit(1)`).\n\nYou can also use this query and then select a specific property:\n\n```js\ntable[prop1 = value]:order(-prop2):first().prop2\n```\n\n### COMMENT\n\n```js\n// comment\n```\n\n### FOR (loop)\n\n```js\nfor \u003cexpression\u003e {\n\t...\n}\n```\n\n### IF (condition)\n\n```js\nif \u003cstatement\u003e {\n\t...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdresende%2Fnode-sqlaudit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdresende%2Fnode-sqlaudit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdresende%2Fnode-sqlaudit/lists"}