You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-36Lines changed: 72 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# DBX
2
2
3
-
DBX is a tool to generate database schemas and code to operate with it. It currently generates Go bindings to Postgres and/or SQLite, but it should be fairly straightforward to add other database *and* language targets.
3
+
DBX is a tool to generate database schemas and code to operate with it. It
4
+
currently generates Go bindings to Postgres and/or SQLite, but it should be
5
+
fairly straightforward to add other database *and* language targets.
4
6
5
7
## How it works
6
8
@@ -42,34 +44,24 @@ source with the command
42
44
$ dbx.v1 golang example.dbx .
43
45
```
44
46
45
-
This will create an `example.go` file in the current directory.
47
+
This will create an `example.go` file in the current directory. Check the
48
+
output of `dbx.v1 golang` for more options like controling the package name or
49
+
other features of the generated code.
46
50
47
-
Generating a schema is also pretty straightforward:
51
+
Generating a schema is also straightforward:
48
52
49
53
```
50
-
$ dbx.v1 schema examples.dbx
54
+
$ dbx.v1 schema examples.dbx .
51
55
```
52
56
53
-
By default DBX will generate code for all of the models and fields and use the
54
-
postgres SQL dialect. You can support multiple SQL dialects:
57
+
This creates an `example.dbx.postgres.sql` file in the current directory with
58
+
sql statements to create the tables for the models.
0 commit comments