Skip to content

Commit 5fd1842

Browse files
committed
some README updates
1 parent dc1f230 commit 5fd1842

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,15 @@ Now that you have your connection to the database you can start executing querie
8484

8585
Pop features CLI support via the `soda` command for the following operations:
8686

87-
* creating databases
88-
* dropping databases
89-
* migrating databases
87+
```bash
88+
Available Commands:
89+
create Creates databases for you
90+
drop Drops databases for you
91+
generate
92+
help Help about any command
93+
migrate Runs migrations against your database.
94+
schema Tools for working with your database schema
95+
```
9096

9197
### Installing CLI Support
9298

@@ -97,7 +103,7 @@ $ go get github.com/gobuffalo/pop/...
97103
$ go install github.com/gobuffalo/pop/soda
98104
```
99105

100-
**with** sqlite 3 support:
106+
**With** sqlite 3 support:
101107

102108
```bash
103109
$ go get -u -v -tags sqlite github.com/gobuffalo/pop/...
@@ -345,7 +351,7 @@ err = tx.Eager("Books").Where("name = 'Mark'").All(&u) // preload only Books as
345351
pop allows you to eager loading nested associations by using `.` character to concatenate them. Take a look at the example bellow.
346352
```go
347353
tx.Eager("Books.User").First(&u) // will load all Books for u and for every Book will load the user which will be the same as u.
348-
```
354+
```
349355
```go
350356
tx.Eager("Books.Writers").First(&u) // will load all Books for u and for every Book will load all Writers.
351357
```

fizz/README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ create_table("todos", func(t) {
2323
})
2424
```
2525

26-
The `create_table` function will also generate an `id` column of type `integer` that will auto-increment. It will also generate two `timestamp` columns; `created_at` and `updated_at`.
26+
The `create_table` function will generate an `id` column of type `integer` that will auto-increment. This can be changed to use the [`UUID`](https://github.com/gobuffalo/uuid) type:
2727

28-
Columns all have the same syntax. First is the name of the column. Second is the type of the field. Third is any options you want to set on that column.
28+
```javascript
29+
create_table("users", func(t) {
30+
t.Column("id", "uuid", {})
31+
// ...
32+
})
33+
```
34+
35+
It will also generate two `timestamp` columns; `created_at` and `updated_at`.
36+
37+
The `t.Columns` method takes the following arguments: name of the column, the type of the field, and finally the last argument is any options you want to set on that column.
2938

3039
#### <a name="column-info"></a> "Common" Types:
3140

@@ -34,8 +43,11 @@ Columns all have the same syntax. First is the name of the column. Second is the
3443
* `timestamp`, `time`, `datetime`
3544
* `integer`
3645
* `bool`
46+
* `uuid`
47+
48+
Any other type passed it will be be passed straight through to the underlying database.
3749

38-
Any other type passed it will be be passed straight through to the underlying database. For example for PostgreSQL you could pass `jsonb`and it will be supported, however, SQLite will yell very loudly at you if you do the same thing!
50+
For example for PostgreSQL you could pass `jsonb`and it will be supported, however, SQLite will yell very loudly at you if you do the same thing!
3951

4052
#### Supported Options:
4153

@@ -145,7 +157,7 @@ add_foreign_key("table_name", "field", {"ref_table_name": ["ref_column"]}, {
145157
* `on_delete` - `CASCADE`, `SET NULL`, ...
146158
* `on_update`
147159

148-
**Note:** `on_update` and `on_delete` are not supported on cockroachDB yet.
160+
**Note:** `on_update` and `on_delete` are not supported on CockroachDB yet.
149161

150162
## Drop a Foreign Key
151163

0 commit comments

Comments
 (0)