diff --git a/cli/commands/init.zig b/cli/commands/init.zig index 42ae81e..934a3fe 100644 --- a/cli/commands/init.zig +++ b/cli/commands/init.zig @@ -106,7 +106,7 @@ pub fn run( try copySourceFile( allocator, install_dir, - "demo/config/database.zig", + "demo/config/database_template.zig", "config/database.zig", null, ); diff --git a/demo/config/database_template.zig b/demo/config/database_template.zig new file mode 100644 index 0000000..676b606 --- /dev/null +++ b/demo/config/database_template.zig @@ -0,0 +1,48 @@ +pub const database = .{ + // Null adapter fails when a database call is invoked. + .development = .{ + .adapter = .null, + }, + .testing = .{ + .adapter = .null, + }, + .production = .{ + .adapter = .null, + }, + // PostgreSQL adapter configuration. + // + // All options except `adapter` can be configured using environment variables: + // + // * JETQUERY_HOSTNAME + // * JETQUERY_PORT + // * JETQUERY_USERNAME + // * JETQUERY_PASSWORD + // * JETQUERY_DATABASE + // + // .testing = .{ + // .adapter = .postgresql, + // .hostname = "localhost", + // .port = 5432, + // .username = "postgres", + // .password = "password", + // .database = "myapp_testing", + // }, + // + // .development = .{ + // .adapter = .postgresql, + // .hostname = "localhost", + // .port = 5432, + // .username = "postgres", + // .password = "password", + // .database = "myapp_development", + // }, + // + // .production = .{ + // .adapter = .postgresql, + // .hostname = "localhost", + // .port = 5432, + // .username = "postgres", + // .password = "password", + // .database = "myapp_production", + // }, +};