mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-05-14 14:06:08 +00:00
Create a template file for init
This allows us to use database.zig for CI, while still creating a blank database.zig for new projects that are created via jetzig init
This commit is contained in:
parent
359b4fc2eb
commit
9e4e8529c5
@ -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,
|
||||
);
|
||||
|
48
demo/config/database_template.zig
Normal file
48
demo/config/database_template.zig
Normal file
@ -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",
|
||||
// },
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user