{"id":15049240,"url":"https://github.com/blhmr/baredb","last_synced_at":"2026-03-27T04:19:52.218Z","repository":{"id":216183005,"uuid":"740667832","full_name":"blhmr/BareDB","owner":"blhmr","description":"BareDB is a lightweight and easy-to-use C library for basic database operations. It allows you to add, read, update, and delete structs in a database file.","archived":false,"fork":false,"pushed_at":"2024-01-11T21:54:59.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T01:16:21.021Z","etag":null,"topics":["c99","clang","database","gcc","generic","struct","structure"],"latest_commit_sha":null,"homepage":"","language":"C","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/blhmr.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":"2024-01-08T20:20:43.000Z","updated_at":"2024-01-25T20:46:36.000Z","dependencies_parsed_at":"2024-10-12T17:20:41.558Z","dependency_job_id":null,"html_url":"https://github.com/blhmr/BareDB","commit_stats":null,"previous_names":["blhmr/baredb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FBareDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FBareDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FBareDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FBareDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blhmr","download_url":"https://codeload.github.com/blhmr/BareDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243505960,"owners_count":20301619,"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":["c99","clang","database","gcc","generic","struct","structure"],"created_at":"2024-09-24T21:19:14.189Z","updated_at":"2025-12-27T23:14:57.507Z","avatar_url":"https://github.com/blhmr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BareDB - Minimalistic and Lightweight C Library for Generic Struct Database\n\nBareDB is a lightweight and easy-to-use C library for basic database operations. It allows you to add, read, update, and delete structs in a database file.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Limitations](#limitations)\n- [Why BareDB](#why-baredb)\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nBareDB is designed to provide a simple yet powerful solution for basic database operations in C. It is open-source and released under the MIT License.\n\n## Features\n\n- Add structs to a database\n- Read structs from a database\n- Update structs in a database\n- Delete structs at a specific index from a database\n- More in the future\n(You can use .bin files)\n\n## Limitations\n- Not endian clean, so portability is an issue especially when you want to write in a little endian machine and read data in a big endian machine (or vice-versa) (Working on this issue)\n\n## Why BareDB\n\nBareDB streamlines basic database operations in C, offering a user-friendly, lightweight solution. With an intuitive interface, it simplifies adding, reading, updating, and deleting structs in a database file. Ideal for beginners, BareDB's minimalist design ensures efficiency, making it a valuable tool for fundamental database functions in C.\n\n## Getting Started\n\nTo use BareDB in your C project, follow these steps:\n\n1. Clone this repo:\n```bash\ngit clone https://github.com/blhmr/BareDB.git\n```\n\n2. Change directory and build to see an example of usage (`main.c`):\n```bash\ncd BareDB\nmake build\n./main\n```\n\n3. In case you to install the library as a default library on your system (Linux):\n- For a static library:\n```bash\ngcc -c baredb.c -o libbaredb.o # Compile the Library\nar rcs libbaredb.a libbaredb.o\nsudo cp libbaredb.so /usr/lib # Copy the Library\nsudo ldconfig # Update Library Cache\nsudo cp baredb.h /usr/include # Include Header Files\n```\n\nUsage in Programs:\n```c\n#include \u003cbaredb.h\u003e\n\nint main(void) {\n    // Your program logic using BareDB functions\n    return 0;\n}\n```\n\n```bash\ngcc -o your_program your_program.c -lbaredb\n```\n\n5. Clean:\n```bash\nmake clean\n```\n\n## Usage\n\nBellow is a simple program to insert a point struct into a \"database.db\" database:\n\n```c\n#include \"baredb.h\"\n\n#pragma packed 1\n\ntypedef struct {\n    int x;\n    int y;\n} point;\n\nint main(void) {\n    // Open the database\n    table_t table;\n    bare_open(\u0026table, \"database.db\", sizeof(point));\n\n    // Create a point struct with specific values\n    point p = {.x = 5, .y = 10};\n\n    // Insert the point struct into the database\n    bare_insert(\u0026table, \u0026p);\n\n    // Close the database\n    bare_close(\u0026table);\n\n    return 0;\n}\n```\nOf course you can read `main.c` to see how all the functions work!\n\n## Examples\n\nSee the examples directory for usage examples.\n\n## Contributing\n\nContributions are welcome! Feel free to open issues, submit pull requests, or provide feedback.\n\n## License\n\nBareDB is open-source software licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblhmr%2Fbaredb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblhmr%2Fbaredb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblhmr%2Fbaredb/lists"}