{"id":16384389,"url":"https://github.com/faker2048/sqlite_orm_lite","last_synced_at":"2025-10-17T17:36:56.405Z","repository":{"id":249671507,"uuid":"818698113","full_name":"faker2048/sqlite_orm_lite","owner":"faker2048","description":"A lightweight, easy-to-read code C++20 SQLite ORM designed for simplicity and basic operations.","archived":false,"fork":false,"pushed_at":"2024-07-29T06:43:24.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T12:44:53.990Z","etag":null,"topics":[],"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/faker2048.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-06-22T15:41:27.000Z","updated_at":"2024-07-29T06:43:28.000Z","dependencies_parsed_at":"2024-07-28T08:53:14.985Z","dependency_job_id":"83ca28e4-2b62-460a-a1fb-3298f21dbffb","html_url":"https://github.com/faker2048/sqlite_orm_lite","commit_stats":null,"previous_names":["faker2048/sqlite_orm_lite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faker2048%2Fsqlite_orm_lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faker2048%2Fsqlite_orm_lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faker2048%2Fsqlite_orm_lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faker2048%2Fsqlite_orm_lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faker2048","download_url":"https://codeload.github.com/faker2048/sqlite_orm_lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240114340,"owners_count":19749838,"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-10-11T04:11:20.004Z","updated_at":"2025-10-17T17:36:51.374Z","avatar_url":"https://github.com/faker2048.png","language":"C++","readme":"\n# sqlite_orm_lite\nsqlite orm, C++20, simple, and easy to use.\n\nFeatures:\n- Minimalist: Only 500 lines of code. Easily adaptable to other databases.\n- Modern C++20: Utilizes Template Metaprogramming (TMP) techniques, with no macros involved\n- Intuitive: User-friendly and straightforward API\n## Build\n```bash\ngit clone https://github.com/faker2048/sqlite_orm_lite.git\ncd sqlite_orm_lite\nnix develop # to enter a development shell environment\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake -j\nctest # to run tests\n```\n\n## Usage\n```C++\nstruct MyCustomType {\n  int id;\n  std::string name;\n  double height;\n\n  auto sql_constructor() {\n    return SqlConstructorBuilder()\n        .SetTableName(\"MyCustomType\")\n        .AddColumn(\"id\", \u0026id)\n        .AddColumn(\"name\", \u0026name)\n        .AddColumn(\"height\", \u0026height)\n        .Build();\n  }\n};\n\nTEST(SqliteFileTest, InsertAndRetrieveData) {\n  TmpDir tmp_dir{\"InsertAndRetrieveData\"};\n  SqliteFile db_file(tmp_dir.path() / \"test.db\");\n\n  db_file.EnsureTable\u003cMyCustomType\u003e(); // This will create the table\n\n  MyCustomType data = {1, \"Alice\", 1.70};\n  db_file.Insert(data); // Insert data into the database\n\n  auto retrieved = db_file.GetTable\u003cMyCustomType\u003e();\n  EXPECT_EQ(retrieved.size(), 1);\n  EXPECT_EQ(retrieved[0].id, data.id);\n  EXPECT_EQ(retrieved[0].name, data.name);\n  EXPECT_DOUBLE_EQ(retrieved[0].height, data.height);\n}\n\nTEST(SqliteFileTest, InsertRowsAndRetrieveData) {\n  TmpDir tmp_dir{\"InsertRowsAndRetrieveData\"};\n  SqliteFile db_file(tmp_dir.path() / \"test.db\");\n\n  db_file.EnsureTable\u003cMyCustomType\u003e(); // Ensures that the table exists\n\n  std::vector\u003cMyCustomType\u003e data = {\n      {1, \"Alice\", 1.70}, {2, \"Bob\", 1.80}, {3, \"Charlie\", 1.90}};\n\n  db_file.InsertRows(data); // Insert multiple rows\n\n  auto retrieved = db_file.GetTable\u003cMyCustomType\u003e();\n  EXPECT_EQ(retrieved.size(), data.size());\n  for (int i = 0; i \u003c data.size(); ++i) {\n    EXPECT_EQ(retrieved[i].id, data[i].id);\n    EXPECT_EQ(retrieved[i].name, data[i].name);\n    EXPECT_DOUBLE_EQ(retrieved[i].height, data[i].height);\n  }\n}\n```\n\n## Code Standards\nThis project follows the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). Adhering to these guidelines ensures that the codebase remains clean, consistent, and maintainable.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaker2048%2Fsqlite_orm_lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaker2048%2Fsqlite_orm_lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaker2048%2Fsqlite_orm_lite/lists"}