2024-10-16 12:01:16 +02:00
< p align = "center" >
< a href = "https://code.zeptotech.net/zedd/zrm" >
< picture >
< img alt = "ZRM logo" width = "150" src = "https://code.zeptotech.net/zedd/zrm/raw/branch/main/logo.svg" / >
< / picture >
< / a >
< / p >
< h1 align = "center" >
ZRM
< / h1 >
< h4 align = "center" >
2024-11-27 17:56:09 +01:00
< a href = "https://zedd.zeptotech.net/zrm" > Documentation< / a >
2024-10-16 12:01:16 +02:00
|
< a href = "https://zedd.zeptotech.net/zrm/api" > API< / a >
< / h4 >
< p align = "center" >
Zig relational mapper
< / p >
ZRM is part of [_zedd_ ](https://code.zeptotech.net/zedd ), a collection of useful libraries for zig.
## ZRM
_ZRM_ provides a simple interface to relational databases in Zig. Define your repositories and easily write queries to retrieve and save complex Zig structures.
## Versions
2024-10-22 16:30:11 +02:00
ZRM 0.2.0 is made and tested with zig 0.13.0.
2024-10-16 12:01:16 +02:00
2024-10-16 14:30:08 +02:00
## Work in progress
ZRM aims to handle a lot for you, but it takes time to make. Have a look to [the issues ](https://code.zeptotech.net/zedd/zrm/issues ) to see what is currently planned or being worked on.
2024-10-16 12:01:16 +02:00
## How to use
### Install
In your project directory:
```shell
2024-10-22 16:30:11 +02:00
$ zig fetch --save https://code.zeptotech.net/zedd/zrm/archive/v0.2.0.tar.gz
2024-10-16 12:01:16 +02:00
```
In `build.zig` :
```zig
// Add zrm dependency.
const zrm = b.dependency("zrm", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("zrm", zrm.module("zrm"));
```
2024-11-27 17:56:09 +01:00
### Documentation
A full documentation can be found on [zedd.zeptotech.net/zrm ](https://zedd.zeptotech.net/zrm ).
2024-10-16 12:01:16 +02:00
### Examples
2024-11-27 17:56:09 +01:00
Some examples can be found in `tests` directory:
2024-10-16 12:01:16 +02:00
2024-11-27 17:56:09 +01:00
- [`tests/example.zig` ](https://code.zeptotech.net/zedd/zrm/src/branch/main/tests/example.zig )
2024-10-16 12:01:16 +02:00
- [`tests/repository.zig` ](https://code.zeptotech.net/zedd/zrm/src/branch/main/tests/repository.zig )
- [`tests/composite.zig` ](https://code.zeptotech.net/zedd/zrm/src/branch/main/tests/composite.zig )