Skip to content

Commit 8b411f8

Browse files
committed
fixed test to work with new version
1 parent 754b278 commit 8b411f8

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
var defaultConfigPaths = []string{"./db-gen.json", "./db-gen/db-gen.json", "./db-gen/config.json"}
1313

14-
const localConfigurationPrefix = ".local"
14+
const localConfigurationPrefix = "local"
1515

1616
type Config struct {
1717
PathBase string //for now just using config folder

testing/db-gen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"ModelTemplate": "./templates/model.gotmpl",
99
"ProcessorTemplate": "./templates/processor.gotmpl",
1010
"GeneratedFileExtension": ".cs",
11-
"GeneratedFileCase": "ucamel",
11+
"GeneratedFileCase": "camelcase",
1212
"Generate": [
1313
{
1414
"Schema": "public",

testing/templates/dbcontext.gotmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DbContext
1616
}
1717

1818
{{range $func := .Functions}}
19-
public async {{if $func.HasReturn}}Task< List<{{$func.ModelName}}>>{{else}}Task{{end}} {{snake $func.FunctionName}}({{range $parameter := $func.Parameters}} {{$parameter.PropertyType}} {{$parameter.PropertyName}}, {{end}}CancellationToken ct)
19+
public async {{if $func.HasReturn}}Task< List<{{$func.ModelName}}>>{{else}}Task{{end}} {{snakeCased $func.FunctionName}}({{range $parameter := $func.Parameters}} {{$parameter.PropertyType}} {{$parameter.PropertyName}}, {{end}}CancellationToken ct)
2020
{
2121
var procedureParams = new object[] { {{range $parameter := $func.Parameters}}
2222
{{$parameter.PropertyName}},{{end}}
@@ -28,4 +28,4 @@ class DbContext
2828
{{end}}
2929
}
3030
{{end}}
31-
}
31+
}

testing/templates/model.gotmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ using Database.Common;
44

55
namespace Database.Generated;
66

7-
public class {{.ModelName}}
7+
public class {{.Routine.ModelName}}
88
{
9-
{{range $property := .ReturnProperties}}
9+
{{range $property := .Routine.ReturnProperties}}
1010
[DbColumnMapping("{{$property.DbColumnName}}")] public {{$property.PropertyType}} {{$property.PropertyName}} { get; set; }
1111
{{end}}
12-
}
12+
}

testing/templates/processor.gotmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ using Npgsql;
55

66
namespace Database.Generated;
77

8-
public class {{.ProcessorName}}
8+
public class {{.Routine.ProcessorName}}
99
{
10-
public static {{.ModelName}} Process(NpgsqlDataReader reader, List< ColumnDescriptor> descriptors)
10+
public static {{.Routine.ModelName}} Process(NpgsqlDataReader reader, List< ColumnDescriptor> descriptors)
1111
{
12-
var item = new {{.ModelName}}();
12+
var item = new {{.Routine.ModelName}}();
1313

14-
{{range $property := .ReturnProperties}}
14+
{{range $property := .Routine.ReturnProperties}}
1515
// {{.DbColumnName}} {{.DbColumnType}}
1616
item.{{.PropertyName}} = reader.{{.MapperFunction}}({{.Position}});
1717
{{end}}
1818

1919
return item;
2020
}
21-
}
21+
}

0 commit comments

Comments
 (0)