{"id":20191423,"url":"https://github.com/htfy96/nanosql","last_synced_at":"2026-06-04T18:31:43.241Z","repository":{"id":29134047,"uuid":"32663998","full_name":"htfy96/NanoSQL","owner":"htfy96","description":"Nano encapsulation of SQLite with transaction support","archived":false,"fork":false,"pushed_at":"2015-03-22T06:00:15.000Z","size":140,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T18:52:40.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/htfy96.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}},"created_at":"2015-03-22T05:58:31.000Z","updated_at":"2016-04-24T05:16:34.000Z","dependencies_parsed_at":"2022-08-02T21:34:05.202Z","dependency_job_id":null,"html_url":"https://github.com/htfy96/NanoSQL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FNanoSQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FNanoSQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FNanoSQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2FNanoSQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/htfy96","download_url":"https://codeload.github.com/htfy96/NanoSQL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629736,"owners_count":19993707,"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-11-14T03:49:01.173Z","updated_at":"2025-03-03T07:41:05.200Z","avatar_url":"https://github.com/htfy96.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e NanoSQL是一个简单封装的C++ Sqlite3库，支持简单的事务，同时具有方便、迅速的语法\n\n#基本内容\n##Sql类\n一个实例对应一个文件\n```cpp\nclass Sql\n{\n\t\tSql(const std::string\u0026 filename); //文件名\n\t\t~Sql(); //安全析构\n\t\tRes raw_result; // by get_table(query)\n\t\tstd::string lasterr; //上一个错误\n\t\tbool is_tran() const; //是否在一个事务中？\n\t\tint exec(const std::string\u0026 query, CallbackFunc cb=NULL); //执行语句，回调函数可以省略\n\t\tint get_table(const std::string\u0026 query); //把得到的table存到raw_result中\n\t\tinline char* result(long row, long col); //从1开始，快速获得raw_result中的结果\n\t\tinline char* colName(long col); //读取自raw_result\n\t\tint begin_tran(); //进入事务状态，错误会抛出runtime_error\n\t\tint end_tran();  //离开事务状态，错误会抛出runtime_error\n};\n```\n##Res类\n保存`get_table`的结果，析构时安全释放\n```cpp\ntypedef struct\n{\n\tchar **arr;\n\tint row, col;\n} Res;\n```\n#实例\n详见目录下的`example.cpp`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtfy96%2Fnanosql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtfy96%2Fnanosql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtfy96%2Fnanosql/lists"}