Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![sqlboiler logo](https://i.imgur.com/lMXUTPE.png)

[![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://github.com/volatiletech/sqlboiler/blob/master/LICENSE)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/volatiletech/sqlboiler/v4)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/twitter-payments/sqlboiler/v4)
[![Slack](https://img.shields.io/badge/slack-%23general-lightgrey.svg)](https://sqlboiler.from-the.cloud)
![ActionsCI](https://github.com/volatiletech/sqlboiler/workflows/test/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/volatiletech/sqlboiler)](http://goreportcard.com/report/volatiletech/sqlboiler)
Expand Down Expand Up @@ -170,10 +170,10 @@ of that SQLBoiler also confers the following benefits:

| Database | Driver Location |
| ----------------- | --------------------------------------------------------------------------------------------------- |
| PostgreSQL | [https://github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql](drivers/sqlboiler-psql) |
| MySQL | [https://github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-mysql](drivers/sqlboiler-mysql) |
| MSSQLServer 2012+ | [https://github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-mssql](drivers/sqlboiler-mssql) |
| SQLite3 | [https://github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-sqlite3](drivers/sqlboiler-sqlite3) |
| PostgreSQL | [https://github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-psql](drivers/sqlboiler-psql) |
| MySQL | [https://github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-mysql](drivers/sqlboiler-mysql) |
| MSSQLServer 2012+ | [https://github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-mssql](drivers/sqlboiler-mssql) |
| SQLite3 | [https://github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-sqlite3](drivers/sqlboiler-sqlite3) |
| CockroachDB | https://github.com/glerchundi/sqlboiler-crdb |

**Note:** SQLBoiler supports out of band driver support so you can make your own
Expand All @@ -187,7 +187,7 @@ For a comprehensive list of available operations and examples please see [Featur
```go
import (
// Import this so we don't have to use qm.Limit etc.
. "github.com/volatiletech/sqlboiler/v4/queries/qm"
. "github.com/twitter-payments/sqlboiler/v4/queries/qm"
)

// Open handle to database like normal
Expand Down Expand Up @@ -309,16 +309,16 @@ Ensure you don't forget any /v suffixes or you'll end up on an old version.

```shell
# Go 1.16 and above:
go install github.com/volatiletech/sqlboiler/v4@latest
go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql@latest
go install github.com/twitter-payments/sqlboiler/v4@latest
go install github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-psql@latest

# Go 1.15 and below:
# Install sqlboiler v4 and the postgresql driver (mysql, mssql, sqlite3 also available)
# NOTE: DO NOT run this inside another Go module (like your project) as it will
# pollute your go.mod with a bunch of stuff you don't want and your binary
# will not get installed.
GO111MODULE=on go get -u -t github.com/volatiletech/sqlboiler/v4
GO111MODULE=on go get github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql
GO111MODULE=on go get -u -t github.com/twitter-payments/sqlboiler/v4
GO111MODULE=on go get github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-psql
```

To install `sqlboiler` as a dependency in your project use the commands below
Expand All @@ -327,7 +327,7 @@ into your `go.mod` file at the correct version.

```shell
# Do not forget the trailing /v4 and /v8 in the following commands
go get github.com/volatiletech/sqlboiler/v4
go get github.com/twitter-payments/sqlboiler/v4
# Assuming you're going to use the null package for its additional null types
go get github.com/volatiletech/null/v8
```
Expand Down Expand Up @@ -1241,7 +1241,7 @@ safe, but be careful!

```go
// Dot import so we can access query mods directly instead of prefixing with "qm."
import . "github.com/volatiletech/sqlboiler/v4/queries/qm"
import . "github.com/twitter-payments/sqlboiler/v4/queries/qm"

// Use a raw query against a generated struct (Pilot in this example)
// If this query mod exists in your call, it will override the others.
Expand Down Expand Up @@ -1381,7 +1381,7 @@ in combination with your own custom, non-generated model.

### Binding

For a comprehensive ruleset for `Bind()` you can refer to our [pkg.go.dev](https://pkg.go.dev/github.com/volatiletech/sqlboiler/v4/queries#Bind).
For a comprehensive ruleset for `Bind()` you can refer to our [pkg.go.dev](https://pkg.go.dev/github.com/twitter-payments/sqlboiler/v4/queries#Bind).

The `Bind()` [Finisher](#finisher) allows the results of a query built with
the [Raw SQL](#raw-query) method or the [Query Builder](#query-building) methods to be bound
Expand Down Expand Up @@ -1661,7 +1661,7 @@ tx.Rollback()

It's also worth noting that there's a way to take advantage of `boil.SetDB()`
by using the
[boil.BeginTx()](https://pkg.go.dev/github.com/volatiletech/sqlboiler/v4/boil#BeginTx)
[boil.BeginTx()](https://pkg.go.dev/github.com/twitter-payments/sqlboiler/v4/boil#BeginTx)
function. This opens a transaction using the globally stored database.

### Debug Logging
Expand Down Expand Up @@ -1736,7 +1736,7 @@ greylist in cases where you want to insert a Go zero value.
**NOTE:** CreatedAt/UpdatedAt are not included in `Whitelist` automatically.

See the documentation for
[boil.Columns.InsertColumnSet](https://pkg.go.dev/github.com/volatiletech/sqlboiler/v4/boil/#Columns.InsertColumnSet)
[boil.Columns.InsertColumnSet](https://pkg.go.dev/github.com/twitter-payments/sqlboiler/v4/boil/#Columns.InsertColumnSet)
for more details.

```go
Expand Down Expand Up @@ -1789,7 +1789,7 @@ documentation above for more details.
**NOTE:** CreatedAt/UpdatedAt are not included in `Whitelist` automatically.

See the documentation for
[boil.Columns.UpdateColumnSet](https://pkg.go.dev/github.com/volatiletech/sqlboiler/v4/boil/#Columns.UpdateColumnSet)
[boil.Columns.UpdateColumnSet](https://pkg.go.dev/github.com/twitter-payments/sqlboiler/v4/boil/#Columns.UpdateColumnSet)
for more details.

```go
Expand Down
2 changes: 1 addition & 1 deletion boil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DRIVER_DB="sqlboiler_driver_test"
build() {
driver=$1

buildPath=github.com/volatiletech/sqlboiler/v4
buildPath=github.com/twitter-payments/sqlboiler/v4
case "${driver}" in
all)
set -o xtrace
Expand Down
2 changes: 1 addition & 1 deletion boilingcore/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"unicode"
"unicode/utf8"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/volatiletech/strmangle"
)

Expand Down
2 changes: 1 addition & 1 deletion boilingcore/aliases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
)

func TestAliasesTables(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions boilingcore/boilingcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/friendsofgo/errors"
"github.com/volatiletech/strmangle"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/importers"
boiltemplates "github.com/volatiletech/sqlboiler/v4/templates"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/importers"
boiltemplates "github.com/twitter-payments/sqlboiler/v4/templates"
)

var (
Expand Down Expand Up @@ -749,7 +749,7 @@ func (s *State) verifyModVersion() error {
return fmt.Errorf(fmt.Sprintf("could not read go.mod: %v", err))
}

re, err := regexp.Compile(`github\.com\/volatiletech\/sqlboiler\/v4 v(\d*\.\d*\.\d*)`)
re, err := regexp.Compile(`github\.com\/twitter-payments\/sqlboiler\/v4 v(\d*\.\d*\.\d*)`)
if err != nil {
return fmt.Errorf(fmt.Sprintf("failed to parse regexp: %v", err))
}
Expand All @@ -762,7 +762,7 @@ func (s *State) verifyModVersion() error {
return fmt.Errorf(
"\tsqlboiler version in go.mod (%s) does not match executable version (%s)."+
"\n\tYou can update it with:"+
"\n\tgo get github.com/volatiletech/sqlboiler/v4",
"\n\tgo get github.com/twitter-payments/sqlboiler/v4",
string(match[0]),
s.Config.Version,
)
Expand Down
8 changes: 4 additions & 4 deletions boilingcore/boilingcore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"strconv"
"testing"

"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/importers"
"github.com/volatiletech/strmangle"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/drivers/mocks"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers/mocks"
)

var state *State
Expand Down Expand Up @@ -117,7 +117,7 @@ func testNew(t *testing.T, aliases Aliases) {
fmt.Println()
}

cmd = exec.Command("go", "mod", "edit", fmt.Sprintf("-replace=github.com/volatiletech/sqlboiler/v4=%s", filepath.Dir(string(goModFilePath))))
cmd = exec.Command("go", "mod", "edit", fmt.Sprintf("-replace=github.com/twitter-payments/sqlboiler/v4=%s", filepath.Dir(string(goModFilePath))))
cmd.Dir = state.Config.OutFolder
cmd.Stderr = buf

Expand Down
4 changes: 2 additions & 2 deletions boilingcore/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/friendsofgo/errors"
"github.com/spf13/cast"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/importers"
)

type TagCase string
Expand Down
2 changes: 1 addition & 1 deletion boilingcore/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
)

func TestConfig_OutputDirDepth(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions boilingcore/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"text/template"

"github.com/friendsofgo/errors"
"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/importers"
)

// Copied from the go source
Expand All @@ -25,7 +25,7 @@ var (
)

var (
noEditDisclaimerFmt = `// Code generated by SQLBoiler%s(https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
noEditDisclaimerFmt = `// Code generated by SQLBoiler%s(https://github.com/twitter-payments/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.

`
Expand Down
2 changes: 1 addition & 1 deletion boilingcore/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/friendsofgo/errors"
"github.com/volatiletech/strmangle"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
)

// templateData for sqlboiler templates
Expand Down
6 changes: 3 additions & 3 deletions boilingcore/text_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package boilingcore
import (
"strings"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/volatiletech/strmangle"
)

Expand Down Expand Up @@ -71,8 +71,8 @@ func txtNameToOne(fk drivers.ForeignKey) (localFn, foreignFn string) {
//
// The output of the foreign key is the name for that side of the relationship.
//
// | tags | | tags_videos | | videos |
// | id | | tag_id, video_id | | id |
// | tags | | tags_videos | | videos |
// | id | | tag_id, video_id | | id |
//
// In this setup the lhs is the tag_id foreign key, and so the lhsFn will
// refer to "how to name the lhs" which in this case should be tags. And
Expand Down
2 changes: 1 addition & 1 deletion boilingcore/text_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package boilingcore
import (
"testing"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
)

func TestTxtNameToOne(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/binary_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os/exec"

"github.com/friendsofgo/errors"
"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/importers"
)

type binaryDriver string
Expand Down
2 changes: 1 addition & 1 deletion drivers/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/friendsofgo/errors"
"github.com/volatiletech/strmangle"

"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/importers"
)

// These constants are used in the config map passed into the driver
Expand Down
4 changes: 2 additions & 2 deletions drivers/mocks/mock.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mocks

import (
"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/importers"
"github.com/volatiletech/strmangle"
)

Expand Down
2 changes: 1 addition & 1 deletion drivers/registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package drivers
import (
"testing"

"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/importers"
)

type testRegistrationDriver struct{}
Expand Down
12 changes: 6 additions & 6 deletions drivers/sqlboiler-mssql/driver/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
_ "github.com/microsoft/go-mssqldb"
"github.com/volatiletech/strmangle"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/importers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/importers"
)

//go:embed override
Expand Down Expand Up @@ -556,7 +556,7 @@ func (MSSQLDriver) Imports() (col importers.Collection, err error) {
},
ThirdParty: importers.List{
`"github.com/volatiletech/strmangle"`,
`"github.com/volatiletech/sqlboiler/v4/drivers"`,
`"github.com/twitter-payments/sqlboiler/v4/drivers"`,
},
},
}
Expand All @@ -580,7 +580,7 @@ func (MSSQLDriver) Imports() (col importers.Collection, err error) {
`"github.com/kat-co/vala"`,
`"github.com/friendsofgo/errors"`,
`"github.com/spf13/viper"`,
`"github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-mssql/driver"`,
`"github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-mssql/driver"`,
`"github.com/volatiletech/randomize"`,
`_ "github.com/microsoft/go-mssqldb"`,
},
Expand Down Expand Up @@ -640,10 +640,10 @@ func (MSSQLDriver) Imports() (col importers.Collection, err error) {
Standard: importers.List{`"time"`},
},
"types.Decimal": {
Standard: importers.List{`"github.com/volatiletech/sqlboiler/v4/types"`},
Standard: importers.List{`"github.com/twitter-payments/sqlboiler/v4/types"`},
},
"types.NullDecimal": {
Standard: importers.List{`"github.com/volatiletech/sqlboiler/v4/types"`},
Standard: importers.List{`"github.com/twitter-payments/sqlboiler/v4/types"`},
},
"mssql.UniqueIdentifier": {
Standard: importers.List{`"github.com/microsoft/go-mssqldb"`},
Expand Down
2 changes: 1 addition & 1 deletion drivers/sqlboiler-mssql/driver/mssql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"regexp"
"testing"

"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions drivers/sqlboiler-mssql/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-mssql/driver"
"github.com/twitter-payments/sqlboiler/v4/drivers"
"github.com/twitter-payments/sqlboiler/v4/drivers/sqlboiler-mssql/driver"
)

func main() {
Expand Down
Loading