summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2021-04-12 22:18:08 +0200
committerGravatar Vincent Rischmann2021-04-12 22:52:27 +0200
commitfba32d2ecd07be2f1f30d7e9156ca51ca2b58fe1 (patch)
tree298e996319325e7546a9ed62dc1d75f1e2b829d1 /README.md
parentMerge branch 'zigmod' (diff)
downloadzig-sqlite-fba32d2ecd07be2f1f30d7e9156ca51ca2b58fe1.tar.gz
zig-sqlite-fba32d2ecd07be2f1f30d7e9156ca51ca2b58fe1.tar.xz
zig-sqlite-fba32d2ecd07be2f1f30d7e9156ca51ca2b58fe1.zip
document how to use zigmod
Diffstat (limited to '')
-rw-r--r--README.md31
1 files changed, 28 insertions, 3 deletions
diff --git a/README.md b/README.md
index aeeff31..933feef 100644
--- a/README.md
+++ b/README.md
@@ -25,12 +25,37 @@ For sqlite, you have options depending on your target:
25 25
26# Installation 26# Installation
27 27
28Since there's no package manager for Zig yet, the recommended way is to use a git submodule: 28There are two primary ways to include `zig-sqlite` in your project:
29* using the [zigmod](https://github.com/nektro/zigmod) package manager
30* using a git submodule
29 31
30```bash 32## zigmod
31$ git submodule add https://github.com/vrischmann/zig-sqlite.git third_party/zig-sqlite 33
34Add this to your `zig.mod` file:
35```
36dependencies:
37 - src: git https://github.com/vrischmann/zig-sqlite branch-master
32``` 38```
33 39
40Note that if you're building an executable and not a library you should use `dev_dependencies` instead.
41
42Next run `zigmod fetch`; it should create a `deps.zig` file.
43
44Now in your `build.zig` you can access the package like this:
45```zig
46const deps = @import("deps.zig");
47...
48deps.addAllTo(exe);
49```
50
51This is the easiest way to add `zig-sqlite` because it uses the bundled source code, avoiding all sorts of linking problems.
52
53## Git submodule
54
55If you don't want to use a package manager you can simply add this repository as a git submodule.
56
57Then you need to chose if you want to use the system sqlite library or the bundled source code.
58
34## Using the system sqlite library 59## Using the system sqlite library
35 60
36If you want to use the system sqlite library, add the following to your `build.zig` target(s): 61If you want to use the system sqlite library, add the following to your `build.zig` target(s):