{"id":16336483,"url":"https://github.com/justinwoo/purescript-jajanmen","last_synced_at":"2026-01-24T11:01:18.396Z","repository":{"id":58237365,"uuid":"135217085","full_name":"justinwoo/purescript-jajanmen","owner":"justinwoo","description":"Cool type-safe Symbol query parameterized helper for Node-SQLite3","archived":false,"fork":false,"pushed_at":"2019-03-23T12:42:32.000Z","size":977,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-19T11:36:44.135Z","etag":null,"topics":["purescript","query","sqlite3","type-level"],"latest_commit_sha":null,"homepage":"","language":"PureScript","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/justinwoo.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":"2018-05-28T23:08:19.000Z","updated_at":"2019-10-13T01:09:01.000Z","dependencies_parsed_at":"2022-08-30T22:31:20.758Z","dependency_job_id":null,"html_url":"https://github.com/justinwoo/purescript-jajanmen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/justinwoo/purescript-jajanmen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-jajanmen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-jajanmen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-jajanmen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-jajanmen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justinwoo","download_url":"https://codeload.github.com/justinwoo/purescript-jajanmen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-jajanmen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28573000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T14:39:55.009Z","status":"ssl_error","status_checked_at":"2026-01-19T14:39:01.217Z","response_time":67,"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":["purescript","query","sqlite3","type-level"],"created_at":"2024-10-10T23:44:20.150Z","updated_at":"2026-01-24T11:01:18.345Z","avatar_url":"https://github.com/justinwoo.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PureScript-Jajanmen\n\nCool type-safe Symbol query parameterized helper for [Node-SQLite3](https://github.com/justinwoo/purescript-node-sqlite3).\n\n![](https://i.imgur.com/bYe4UrU.jpg)\n\nBecause jajanmen is delicious, and my other library is called [Chanpon](https://github.com/justinwoo/purescript-chanpon).\n\nSee the post about this library here: \u003chttps://github.com/justinwoo/my-blog-posts#well-typed-parameterized-sqlite-parameters-with-purescript\u003e\n\nSee the talk about this library here: \u003chttps://speakerdeck.com/justinwoo/superior-string-spaghetti-with-purescript-jajanmen\u003e\n\n## Usage\n\nFirst, prepare some queries:\n\n```purs\n-- inferred type:\ngetEm\n  :: forall a b\n   . J.AllowedParamType a\n  =\u003e J.AllowedParamType b\n  =\u003e SL.DBConnection\n  -\u003e { \"$name\" :: a, \"$count\" :: b }\n  -\u003e Aff Foreign\ngetEm db = J.queryDB db queryP\n  where\n    queryP = SProxy :: SProxy \"select name, count from mytable where name = $name and count = $count\"\n\n-- inferred type:\ngetSomethin :: SL.DBConnection -\u003e Aff Foreign\ngetSomethin db = J.queryDB db queryP params\n  where\n    queryP = SProxy :: SProxy \"select name, count from mytable where name = $name and count = $count\"\n    params = { \"$name\": \"asdf\", \"$count\": 4 }\n\n-- inferred type:\naddSomethin\n  :: forall a b\n   . J.AllowedParamType a\n  =\u003e J.AllowedParamType b\n  =\u003e SL.DBConnection\n  -\u003e { \"$name\" :: a, \"$count\" :: b }\n  -\u003e Aff Foreign\naddSomethin db params = J.queryDB db queryP params\n  where\n    queryP = SProxy :: SProxy \"insert or replace into mytable (name, count) values ($name, $count)\"\n```\n\nThen put it to work:\n\n```purs\ntype MyRow = { name :: String, count :: Int }\n\nmain :: Effect Unit\nmain = launchAff_ do\n  db \u003c- SL.newDB \"./test/testdb.sqlite\"\n  _ \u003c- SL.queryDB db \"create table if not exists mytable (name text, count int)\" []\n  _ \u003c- SL.queryDB db \"delete from mytable\" []\n  _ \u003c- addSomethin db { \"$name\": \"apples\", \"$count\": 3 }\n  _ \u003c- addSomethin db { \"$name\": \"asdf\", \"$count\": 4 }\n\n  f1 \u003c- getEm db { \"$name\": \"apples\", \"$count\": 3 }\n  testResult f1 [{ name: \"apples\", count: 3 }]\n\n  f2 \u003c- getSomethin db\n  testResult f2 [{ name: \"asdf\", count: 4 }]\n\n  log \"tests passed\"\n  where\n    testResult f expected =\n      case JSON.read f of\n        Left e -\u003e throwError (error $ show e)\n        Right (actual :: Array MyRow) -\u003e assertEqual { actual, expected }\n    assertEqual = liftEffect \u003c\u003c\u003c Assert.assertEqual\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinwoo%2Fpurescript-jajanmen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinwoo%2Fpurescript-jajanmen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinwoo%2Fpurescript-jajanmen/lists"}