{"id":21027292,"url":"https://github.com/bynect/mongo-vapi","last_synced_at":"2025-06-10T18:33:54.915Z","repository":{"id":107042731,"uuid":"299159155","full_name":"bynect/mongo-vapi","owner":"bynect","description":"Vala bindings for the Mongo C Driver","archived":false,"fork":false,"pushed_at":"2024-01-15T12:17:35.000Z","size":139,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T07:43:14.975Z","etag":null,"topics":["driver","libmongoc","makefile","meson","mesonbuild","mongo","mongoc","mongoclient","mongodb","mongodb-driver","vala","vala-bindings","vala-libraries","vala-library","valac","vapi","vapidir"],"latest_commit_sha":null,"homepage":"","language":"Vala","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/bynect.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":"2020-09-28T01:55:57.000Z","updated_at":"2024-01-15T12:19:44.000Z","dependencies_parsed_at":"2024-01-15T13:45:17.009Z","dependency_job_id":"f4c70055-e952-41cc-b1bf-6eae6570904c","html_url":"https://github.com/bynect/mongo-vapi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fmongo-vapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fmongo-vapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fmongo-vapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fmongo-vapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bynect","download_url":"https://codeload.github.com/bynect/mongo-vapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254323053,"owners_count":22051704,"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":["driver","libmongoc","makefile","meson","mesonbuild","mongo","mongoc","mongoclient","mongodb","mongodb-driver","vala","vala-bindings","vala-libraries","vala-library","valac","vapi","vapidir"],"created_at":"2024-11-19T11:49:22.495Z","updated_at":"2025-05-15T10:32:20.696Z","avatar_url":"https://github.com/bynect.png","language":"Vala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mongo C Vapi\n\nVala bindings for the [Mongo C Driver](https://github.com/mongodb/mongo-c-driver \"mongo-c-driver\").\n\nNote: The bindings are currently not being updated\n\n## Generate VAPI file\n#### Oneliner\n\n```sh\n#the vapi file will be generated in the ./vapi folder\n$ git clone https://github.com/bynect/mongo-vapi.git \u0026\u0026 cd mongo-vapi \u0026\u0026 make compose\n```\n\n#### Generate one file\nYou can generate a single file containing both `libbson` and `libmongoc` bindings living under the _Mongo_ namespace by using this command:\n\n```sh\n#make\n$ make compose\n\n#python (only vapis)\n$ python3 compose.py --onefile\n\n#meson\n$ meson build\n```\n\n#### Generate separated file\nYou can also generate two separate file containing `libbson` and `libmongoc` bindings living under the _Bson_ and _Mongo_ namespace respectively.\n\n```sh\n#for make\n#set the variable in line or export it\n$ SEPARATED_VAPI= make compose\n\n#for python (only vapis)\n$ python3 compose.py\n\n#for meson\n$ meson build -Donefile=false\n```\n\n__If you want to run tests or examples using two different file (separated option), you have to set the `SEPARATED_VAPI` environmental variable.__ (Only for make, Meson does it automatically).\n\n\n## Build with make\n### Examples\n\n```sh\n#hello mongo example\n$ make example-hello\n\n#basic crud operations to local database\n$ make example-crud\n\n#bcon / json example\n$ make example-bcon\n```\n\n__If you want to run tests or examples using two different file (separated option), you have to set the `SEPARATED_VAPI` environmental variable.__\n\n\n### Tests\n\n```sh\n#check connection to local database\n$ make test-status\n```\n\n__If you want to run tests or examples using two different file (separated option), you have to set the `SEPARATED_VAPI` environmental variable.__\n\n\n## Build with Meson\n\nYou can use Meson as an alternative build method to make.\nAvaible options (see meson_options.txt):\n\n* `-Donefile`: Generate a single file and namespace. Default to true.\n\n* `-Dverbose`: Set verbosity. Default to false.\n\n* `-Dtest`: Build test. Default to true.\n\n* `-Dexample`: Build samples. Default to true.\n\n```sh\n#add -Donefile=false for separated vapis\n$ meson build\n#run ninja from the build directory\n$ ninja -C build\n```\n\n\n## Helper\n\nThere is a small Python script that will generate the Vapi from the partials file.\nAlso there is a Makefile that has some helper targets for testing and examples.\n\nYou can see the avaible options using:\n\n```sh\n#Makefile help\n$ make\n\n#Python script help\n$ python3 compose.py -h\n```\n\n\n## Usage\n\nTo use this bindings you have to add the following arguments to `valac`:\n\n* `--pkg libmongoc-1.0`: This links libmongoc to your Vala application.\n\n* `--pkg libbson-1.0`: Add this only if you have generated separated vapis.\n\n* `--vapidir X`: _X_ is the directory where the generated files are stored.\n\n* `--pkg posix`: Add only if you didn't included the `.deps` file in the vapidir.\n\n\nIf you are using Meson you can add the following dependencies:\n\n* dependency('libmongoc-1.0')\n\n* dependency('libbson-1.0')\n\nAlso you need to add the `vapidir` option and the `--pkg` option for posix (if not included in the vapidir), like this:\n\n```meson\nadd_project_arguments(['--vapidir', X, '--pkg', 'posix'], language: 'vala')\n```\n\n_X_ is the directory where the generated files are stored.\n\n\n## Dependencies\n\n* [`libmongoc-1.0`](http://mongoc.org/libmongoc/current/installing.html): the binded library\n\n* `libbson-1.0`: installed with libmongoc, used explicitly if vapis are separated\n\n* `posix`: used for datetime and minor details\n\n* `glib-2.0` and `gobject-2.0`: used by Vala\n\n* `json-glib-1.0`: used by the [BconDoc.vala](samples/BconDoc.vala) samples\n\n\n## Notes\n\n* Because the codebase to bind is fairly big, the vapi file is divided in partials file. The file itself can be easily generated with the included Python script / Makefile / Meson script.\n\n* While the vast majority of the methods and classes have the same or a very similar name to the C counterpart, some of the names maybe a little tweaked to be more Vala-friendly.\n\n* Deprecated or next-to-deprecation features _won't be binded_.\n\n* The tags/releases/versions of this repository are not related to `libmongoc` versions.\n\n* If you need only the VAPI file, you can download it from the [releases allegates](https://github.com/bynect/mongo-vapi/releases). Generating by yourself is probably better though.\n\n* Test and samples require a running instance of mongodb (`mongod`).\n\n* I am not sure if `--pkg posix` is required explicitly, but it is needed for datetime types.\n\n\n## Changelog\n\n* Add meson as an alternative build method.\n\n* Add support for separated vapis for `libbson` and `libmongoc`.\n\n* Add support for BCON notation.\n\n* Add support for Crud operation.\n\nAlso see [TODO.md](./TODO.md).\n\n\n## License\n\nCopyright @bynect\n\nThis is free and open source software.\nYou can use/modify/redistribute it under the terms of the MIT license.\nSee LICENSE for for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbynect%2Fmongo-vapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbynect%2Fmongo-vapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbynect%2Fmongo-vapi/lists"}