I was working on a cli type app with Zig, I couldn't find a way to connect with a database to store my data. Is there a native way to connect to a database with Zig? I couldn't find any docs through google. If there is not a native way to connect to a database how can I download dependencies through the native modules in Zig.
const std = @import("std");
const uri = std.Uri.parse("http://127.0.0.1:8000") catch unreachable;
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = gpa.allocator();
const Pkg = struct {
name: [:0]u8,
src: []u8,
};
const Config = struct {
id: []u8,
name: [:0]u8,
pkgs: ?std.ArrayList(Pkg) = null,
};
pub fn main() !void {
var client: std.http.Client = .{ .allocator = alloc };
var req = try client.request(.GET, uri, .{ .allocator = alloc }, .{});
defer req.deinit();
try req.start();
try req.wait();
}
This is my code and I am using Zig version: 0.11.0-dev.3395+1e7dcaa3a edge.