{"repo":"nDimensional/zig-sqlite","free":true,"listed":false,"github":"https://github.com/nDimensional/zig-sqlite","clone":"git clone https://github.com/nDimensional/zig-sqlite.git","description":"Simple, low-level, explicitly-typed SQLite bindings for Zig.","language":"Zig","stars":52,"topics":["sqlite","sqlite3","zig"],"license":"MIT","category":"databases-storage","readme_excerpt":"zig-sqlite Simple, low-level, explicitly-typed SQLite bindings for Zig. Table of Contents - Installation - Usage - Methods - Queries - Errors - Notes - Build options - License Installation This library is built and tested with Zig version 0.16.0 . Then add sqlite as an import to your root modules in build.zig : Usage Open databases using Database.open and close them with db.close() : Execute one-off statements using Database.exec : Prepare statements using Database.prepare , and finalize them with stmt.finalize() . Statements must be given explicit comptime params and result types, and are typed as sqlite.Statement(Params, Result) . - The comptime Params type must be a struct whose fields are (possibly optional) float, integer, sqlite.Blob , or sqlite.Text types. - The comptime Result type must either be void , indicating a method that returns no data, or a struct of the same kind as param types, indicating a query that returns rows. sqlite.Blob and sqlite.Text are wrapper structs with a single field data: []const u8 . Methods If the Result type is void , use the exec(params: Params): !void method to execute the statement several times with different params. Queries If the Result type is a struct, use stmt.bind(params) in conjunction with defer stmt.reset() , then stmt.step() over the results. ℹ️ Every bind should be paired with a reset , just like every prepare is paired with a finalize . Text and blob values must not be retained across steps. You are responsible for copying","default_branch":null,"files":null,"tree":[],"storefront":"/r/nDimensional","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nDimensional/zig-sqlite/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}