{"id":13772417,"url":"https://github.com/DellCliff/frege-dbc","last_synced_at":"2025-05-11T04:31:23.375Z","repository":{"id":216864360,"uuid":"41882952","full_name":"DellCliff/frege-dbc","owner":"DellCliff","description":null,"archived":false,"fork":false,"pushed_at":"2015-09-03T20:50:08.000Z","size":116,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-13T04:39:02.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Frege","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/DellCliff.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}},"created_at":"2015-09-03T20:47:06.000Z","updated_at":"2024-08-03T17:05:50.263Z","dependencies_parsed_at":null,"dependency_job_id":"534c9131-76b3-4a34-8739-c5e1cd1e7a31","html_url":"https://github.com/DellCliff/frege-dbc","commit_stats":null,"previous_names":["dellcliff/frege-dbc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DellCliff%2Ffrege-dbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DellCliff%2Ffrege-dbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DellCliff%2Ffrege-dbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DellCliff%2Ffrege-dbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DellCliff","download_url":"https://codeload.github.com/DellCliff/frege-dbc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518941,"owners_count":21921074,"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-08-03T17:01:03.771Z","updated_at":"2025-05-11T04:31:21.416Z","avatar_url":"https://github.com/DellCliff.png","language":"Frege","funding_links":[],"categories":["Libraries"],"sub_categories":["Databases"],"readme":"# frege-dbc\n\nThis library aims to supply useful functions to deal with JDBC in Frege.\nThe only function right now is to retrieve results from ResultSet.\nfetchRow does not throw exceptions, almost all native JDBC might though, so use with care.\n\n```\nmodule Main where\n\nimport frege_dbc.JDBC\nimport frege_dbc.FregeDBC\n\ndrop_table_sql = \"DROP TABLE IF EXISTS  people\"\n\ncreate_table_sql = \"CREATE TABLE people (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, dob TEXT NOT NULL);\"\n\ninsert_sql = \"INSERT INTO people (name, dob) VALUES (\\\"user 1\\\", \\\"2015-08-22T05:31:54\\\"), (\\\"user 2\\\", \\\"1955-01-10T05:31:54\\\"), (\\\"user 3\\\", \\\"1985-03-7T05:31:54\\\");\"\n\nquery_people_sql = \"SELECT * FROM people;\"\n\ninstance Show SqlValue where\n    show (SqlString s) = \"String: \" ++ s\n    show (SqlInt s) = \"Int: \" ++ show s\n    show (SqlLong s) = \"Long: \" ++ show s\n    show t = \"Some value\"\n\nmain = do\n    println \"START\"\n    conn \u003c- DriverManager.getConnection \"jdbc:sqlite:sample.db\"\n    stmt \u003c- Connection.createStatement conn\n\n    drop_res \u003c- Statement.execute stmt drop_table_sql\n    create_res \u003c- Statement.execute stmt create_table_sql\n    insert_res \u003c- Statement.execute stmt insert_sql\n    -- true if the first result is a ResultSet object;\n    -- false if the first result is an update count or there is no result\n    print \"drop_res: \"; println drop_res\n    print \"create_res: \"; println create_res\n    print \"insert_res: \"; println insert_res\n\n    people_res \u003c- Statement.executeQuery stmt query_people_sql\n    parsed \u003c- sequence $ [fetchRow people_res | x \u003c- [0..3]] -- more than exist\n\n    println parsed\n\n    println \"END\"\n```\nPrints\n```\nSTART\ndrop_res: false\ncreate_res: false\ninsert_res: false\n[Right [Long: 1, String: user 1, String: 2015-08-22T05:31:54], Right [Long: 2, String: user 2, String: 1955-01-10T05:31:54], Right [Long: 3, String: user 3, String: 1985-03-7T05:31:54], Left java.lang.IllegalStateException: SQLite JDBC: inconsistent internal state]\nEND\nruntime 0.612 wallclock seconds.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDellCliff%2Ffrege-dbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDellCliff%2Ffrege-dbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDellCliff%2Ffrege-dbc/lists"}