{"id":24865511,"url":"https://github.com/melsman/mlkit-postgresql","last_synced_at":"2025-06-25T07:06:28.435Z","repository":{"id":148050722,"uuid":"195188641","full_name":"melsman/mlkit-postgresql","owner":"melsman","description":"Postgresql library for Standard ML / MLKit ","archived":false,"fork":false,"pushed_at":"2021-12-12T23:27:39.000Z","size":51,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T00:53:32.686Z","etag":null,"topics":["smlpkg"],"latest_commit_sha":null,"homepage":"","language":"Standard ML","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/melsman.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-04T07:12:52.000Z","updated_at":"2023-10-25T04:02:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8d3acd6-f116-4780-a5b0-ee54e16b4f13","html_url":"https://github.com/melsman/mlkit-postgresql","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melsman","download_url":"https://codeload.github.com/melsman/mlkit-postgresql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650439,"owners_count":21139672,"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":["smlpkg"],"created_at":"2025-01-31T23:59:59.501Z","updated_at":"2025-04-13T00:53:47.287Z","avatar_url":"https://github.com/melsman.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# # mlkit-postgresql [![CI](https://github.com/melsman/mlkit-postgresql/workflows/CI/badge.svg)](https://github.com/melsman/mlkit-postgresql/actions)\n\nPostgresql library for Standard ML / MLKit\n\nThis library provides access to the postgresql database from within\nSML using the `libpq` API. The functionality is provided through\nseveral layers:\n\n- _High-level API_. Structure __PgDb : [DB](lib/github.com/melsman/mlkit-postgresql/db.sig)__.\n\n- _Medium-level API_. Structure __PgDb.Handle : [DB_HANDLE](lib/github.com/melsman/mlkit-postgresql/db-handle.sig)__.\n\n- _Low-level API_. Structure __Postgresql : [POSTGRESQL](lib/github.com/melsman/mlkit-postgresql/postgresql.sig)__.\n\nWith the medium-level and low-level APIs, the programmer manages and\npropagates connection information explicitly, whereas, with the\nhigh-level API, a single connection is setup and managed through\nside-effecting functions.\n\nThere are two versions of the __PgDb__ and __PgDb.Handle__ structures,\none that treats SQL code as Standard ML strings (available through\n`pgdb.mlb`) and one that treats SQL code as MLKit quotations\n(available through `pgdb-quot.mlb`), which requires `-quot` to be\npassed to `mlkit`.\n\n## Overview of MLB files\n\n- `lib/github.com/melsman/mlkit-postgresql/pgdb.mlb`:\n\n  - **structure** `PgDb` :\u003e [`DB`](lib/github.com/melsman/mlkit-postgresql/db.sig)` where type sql = string`\n\n- `lib/github.com/melsman/mlkit-postgresql/pgdb-quot.mlb`:\n\n  - **structure** `PgDb` :\u003e [`DB`](lib/github.com/melsman/mlkit-postgresql/db.sig)` where type sql = quot`\n\n- `lib/github.com/melsman/mlkit-postgresql/pgdb-fn.mlb`:\n\n  - **signature** [`DB`](lib/github.com/melsman/mlkit-postgresql/db.sig)\n  - **signature** [`DB_HANDLE`](lib/github.com/melsman/mlkit-postgresql/db-handle.sig)\n  - **functor** `PgDbFn` : `(X : ...) -\u003e DB`\n\n- `lib/github.com/melsman/mlkit-postgresql/postgresql.mlb`:\n\n  - **signature** [`POSTGRESQL`](lib/github.com/melsman/mlkit-postgresql/postgresql.sig)\n  - **structure** `Postgresql` :\u003e `POSTGRESQL`\n\n## Assumptions\n\nA working MLKit installation (see\nhttps://github.com/melsman/mlkit). Use `brew install mlkit` on macOS.\n\n### Testing\n\nTo test the library, first do as follows:\n\n    $ cd src\n    $ make\n\nNotice that, dependent on the architecture, you may need first to set the\nenvironment variable `MLKIT_INCLUDEDIR` to something different than\nthe default value `/usr/share/mlkit/include/`. For instance, if you\nuse `brew` under macOS, you should do as follows:\n\n    $ cd src\n    $ MLKIT_INCLUDEDIR=/usr/local/share/mlkit/include/ make\n\nThen, proceed as follows:\n\n    $ cd ../test\n    $ make init\n    $ make\n\nNotice that it may be necessary to tweak the\n[src/Makefile](src/Makefile) and the [test/Makefile](test/Makefile) to\nspecify the location of the MLKit compiler binary, the MLKit include\nfiles, and the MLKit basis library.\n\n## Use of the package\n\nThis library is set up to work well with the SML package manager\n[smlpkg](https://github.com/diku-dk/smlpkg).  To use the package, in\nthe root of your project directory, execute the command:\n\n```\n$ smlpkg add github.com/melsman/mlkit-postgresql\n```\n\nThis command will add a _requirement_ (a line) to the `sml.pkg` file\nin your project directory (and create the file, if there is no file\n`sml.pkg` already).\n\nTo download the library into the directory\n`lib/github.com/melsman/mlkit-postgresql` (along with other necessary\nlibraries), execute the command:\n\n```\n$ smlpkg sync\n```\n\nYou can now reference the `mlb`-file using relative paths from within\nyour project's `mlb`-files.\n\nNotice that you can choose either to treat the downloaded package as\npart of your own project sources (vendoring) or you can add the\n`sml.pkg` file to your project sources and make the `smlpkg sync`\ncommand part of your build process.\n\n\n## Authors\n\nCopyright (c) 2019-2021 Martin Elsman, University of Copenhagen.\n\n## License\n\nSee [LICENSE](LICENSE) (MIT License).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelsman%2Fmlkit-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelsman%2Fmlkit-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelsman%2Fmlkit-postgresql/lists"}