{"repo":"cztomsik/fridge","free":true,"listed":false,"github":"https://github.com/cztomsik/fridge","clone":"git clone https://github.com/cztomsik/fridge.git","description":"A small, batteries-included database library for Zig.","language":"Zig","stars":93,"topics":["sqlite","sqlite3","zig","database","zig-package","query-builder","sql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Fridge I've been doing some breaking changes recently and I'm not done yet so maybe consider staying on 7731bfd7a220482827f7006e0ac6ab641fc41381 for now A small, batteries-included database library for Zig. It offers a type-safe query builder, connection pooling, shorthands for common tasks, migrations, and more. Features - [x] Supports both bundling SQLite3 with your app or linking system SQLite3. - [x] Type-safe + raw query builder. - [x] Connection pool. - [x] Shortcuts for common tasks. - [x] Migrations inspired by David Röthlisberger. - [ ] Additional drivers (e.g., PostgreSQL). - [ ] Documentation. Installation To get started, get the library first: Then, in your build.zig : Basic Usage Fridge's API is highly generic and revolves around user-defined structs. Let's start by adding a few imports and defining a simple struct for the User table: The primary API you'll interact with is always Session . This high-level API wraps the connection with an arena allocator and provides a type-safe query builder. Sessions can be either one-shot or pooled. Let's start with the simplest case: As you can see, Session.open() is generic and expects a driver type, allocator, and connection options. These connection options are driver-specific. Currently, only SQLite3 is supported, but the API is designed to be easily extendable to other drivers, including your own. Now, let's do something useful with the session. For example, we can create a table. Executing DDL statements is a bit specia","default_branch":null,"files":null,"tree":[],"storefront":"/r/cztomsik","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cztomsik/fridge/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."}