Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gofmt'd README example code
Keeps indentation ligned up nicely.
  • Loading branch information
muesli authored Feb 28, 2018
commit 0596d94dcf7e4180433393be3a34bd44d31f2353
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ filling the following contract:

```go
type Recorder interface {
Bind(string, Record) Recorder // link struct to table
Interface() interface{} // Get the struct that has been linked
Insert() error // INSERT just one record
Update() error // UPDATE just one record
Delete() error // DELETE just one record
Exists() (bool, error) // Check for just one record
ExistsWhere(cond interface{}, args ...interface{}) (bool, error)
Load() error // SELECT just one record
LoadWhere(cond interface{}, args ...interface{}) error // Alternate Load()
Bind(string, Record) Recorder // link struct to table
Interface() interface{} // Get the struct that has been linked
Insert() error // INSERT just one record
Update() error // UPDATE just one record
Delete() error // DELETE just one record
Exists() (bool, error) // Check for just one record
ExistsWhere(cond interface{}, args ...interface{}) (bool, error)
Load() error // SELECT just one record
LoadWhere(cond interface{}, args ...interface{}) error // Alternate Load()
}
```

Expand Down Expand Up @@ -61,10 +61,10 @@ To annotate a struct, you do something like this:

```go
type Stool struct {
Id int `stbl:"id, PRIMARY_KEY, AUTO_INCREMENT"`
Legs int `stbl:"number_of_legs"`
Material string `stbl:"material"`
Ignored string // will not be stored. No tag.
Id int `stbl:"id, PRIMARY_KEY, AUTO_INCREMENT"`
Legs int `stbl:"number_of_legs"`
Material string `stbl:"material"`
Ignored string // will not be stored. No tag.
}
```

Expand Down