diff --git a/.travis.yml b/.travis.yml index 2653088a0af25d0f291cc01e8f7a0409ef651d47..f489d41807a97e5e6de4042d878018517045cc2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,21 +18,21 @@ env: GOARCH=amd64 TEST_HOST=127.0.0.1 UPPERIO_DB_DEBUG=1 install: - sudo apt-get install -y bzr make - mkdir -p $GOPATH/src/upper.io/v2 - - mv $PWD $GOPATH/src/upper.io/v2/db - - cd $GOPATH/src/upper.io/v2/db + - mv $PWD $GOPATH/src/upper.io/db + - cd $GOPATH/src/upper.io/db - ls -la - go get -v github.com/cznic/ql/ql # ql command line util. - go get -v -t -d - - go get -v -t -d upper.io/v2/db/mysql - - go get -v -t -d upper.io/v2/db/sqlite - - go get -v -t -d upper.io/v2/db/postgresql - - go get -v -t -d upper.io/v2/db/mongo - - go get -v -t -d upper.io/v2/db/ql + - go get -v -t -d upper.io/db/mysql + - go get -v -t -d upper.io/db/sqlite + - go get -v -t -d upper.io/db/postgresql + - go get -v -t -d upper.io/db/mongo + - go get -v -t -d upper.io/db/ql - go get -v github.com/pkieltyka/sqlx - (cd $GOPATH/src/github.com/pkieltyka/sqlx && git pull -a && git checkout ptrs) # temporal fix - (cp -r $GOPATH/src/github.com/pkieltyka/sqlx/* $GOPATH/src/github.com/jmoiron/sqlx) # temporal fix - (cd $GOPATH/src/github.com/jmoiron/sqlx && go build -a && go install) - - export TRAVIS_BUILD_DIR=$GOPATH/src/upper.io/v2/db + - export TRAVIS_BUILD_DIR=$GOPATH/src/upper.io/db services: - mongodb @@ -55,9 +55,9 @@ before_script: - cat ql/_dumps/structs.sql | $GOPATH/bin/ql -db ql/_dumps/test.db script: - - cd $GOPATH/src/upper.io/v2/db - - go test upper.io/v2/db/mysql -test.bench=. - - go test upper.io/v2/db/sqlite -test.bench=. - - go test upper.io/v2/db/ql -test.bench=. - - go test upper.io/v2/db/mongo -test.bench=. + - cd $GOPATH/src/upper.io/db + - go test upper.io/db/mysql -test.bench=. + - go test upper.io/db/sqlite -test.bench=. + - go test upper.io/db/ql -test.bench=. + - go test upper.io/db/mongo -test.bench=. - go test -test.v diff --git a/README.md b/README.md index d8da77fe8e80d0542f90c7354410922af9053d5c..de32bf6cd68c5c4a8ba1a0c567d89cc003fd18a4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# upper.io/v2/db +# upper.io/db *V2 IS CURRENTLY IN DEVELOPMENT AND NOT YET READY TO USE* @@ -10,15 +10,15 @@ ## The `db` package - + -`upper.io/v2/db` is a [Go][2] package that allows developers to communicate with +`upper.io/db` is a [Go][2] package that allows developers to communicate with different databases through the use of *adapters* that wrap well-supported database drivers. -## Is `upper.io/v2/db` an ORM? +## Is `upper.io/db` an ORM? -`upper.io/v2/db` is not an ORM in the sense that it does not tell you how to +`upper.io/db` is not an ORM in the sense that it does not tell you how to design your software or how to validate your data, instead it only focuses on being a tool that deals with common operations on different databases: @@ -31,26 +31,26 @@ res = col.Find(db.Cond{"name": "Max"}).Limit(10).Sort("-last_name") err = res.All(&people) ``` -In strict sense `upper.io/v2/db` could be considered a really basic non-magical +In strict sense `upper.io/db` could be considered a really basic non-magical ORM that rather stays out of the way. ## Supported databases - + -`upper.io/v2/db` attempts to provide full compatiblity for [CRUD][2] operations +`upper.io/db` attempts to provide full compatiblity for [CRUD][2] operations across adapters. Some other operations (such *transactions*) are supported only on specific database adapters, such as MySQL, PostgreSQL and SQLite. -* [MongoDB](https://upper.io/v2/db/mongo) via [mgo](http://godoc.org/labix.org/v2/mgo) -* [MySQL](https://upper.io/v2/db/mysql) via [mysql](https://github.com/go-sql-driver/mysql) -* [PostgreSQL](https://upper.io/v2/db/postgresql) via [pq](https://github.com/lib/pq) -* [QL](https://upper.io/v2/db/ql) via [ql](https://github.com/cznic/ql) -* [SQLite3](https://upper.io/v2/db/sqlite) via [go-sqlite3](https://github.com/mattn/go-sqlite3) +* [MongoDB](https://upper.io/db/mongo) via [mgo](http://godoc.org/labix.org/v2/mgo) +* [MySQL](https://upper.io/db/mysql) via [mysql](https://github.com/go-sql-driver/mysql) +* [PostgreSQL](https://upper.io/db/postgresql) via [pq](https://github.com/lib/pq) +* [QL](https://upper.io/db/ql) via [ql](https://github.com/cznic/ql) +* [SQLite3](https://upper.io/db/sqlite) via [go-sqlite3](https://github.com/mattn/go-sqlite3) ## User documentation -See the project page, recipes and user documentation at [upper.io/v2/db][1]. +See the project page, recipes and user documentation at [upper.io/db][1]. ## License @@ -75,6 +75,6 @@ See the project page, recipes and user documentation at [upper.io/v2/db][1]. > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -[1]: https://upper.io/v2/db +[1]: https://upper.io/db [2]: http://golang.org [3]: http://en.wikipedia.org/wiki/Create,_read,_update_and_delete diff --git a/db.go b/db.go index d243413715430cea7ea9da1edff267a6cba8c5be..9807a3aac46e874aab8b215a0dbda660fd8bc557 100644 --- a/db.go +++ b/db.go @@ -22,19 +22,19 @@ // Package db provides a single interface for interacting with different data // sources through the use of adapters that wrap well-known database drivers. // -// As of today, `upper.io/v2/db` fully supports MySQL, PostgreSQL and SQLite (CRUD +// As of today, `upper.io/db` fully supports MySQL, PostgreSQL and SQLite (CRUD // + Transactions) and provides partial support for MongoDB and QL (CRUD only). // // Usage: // // import( // // Main package. -// "upper.io/v2/db" +// "upper.io/db" // // PostgreSQL adapter. -// "upper.io/v2/db/postgresql" +// "upper.io/db/postgresql" // ) // -// `upper.io/v2/db` is not an ORM and thus does not impose any hard restrictions +// `upper.io/db` is not an ORM and thus does not impose any hard restrictions // on data structures: // // // This code works the same for all supported databases. @@ -42,7 +42,7 @@ // res = col.Find(db.Cond{"name": "Max"}).Limit(2).Sort("-input") // err = res.All(&people) -package db // import "upper.io/v2/db" +package db // import "upper.io/db" // Cond is a map used to define conditions passed to `db.Collection.Find()` and // `db.Result.Where()`. diff --git a/db_test.go b/db_test.go index 09226836b54a56edf145f75e7e8ab1003ec4457a..9d9023c549ff90dff386ad79b4fb2bfe42571990 100644 --- a/db_test.go +++ b/db_test.go @@ -34,13 +34,13 @@ import ( "github.com/jmoiron/sqlx" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" - "upper.io/v2/db" - "upper.io/v2/db/mongo" + "upper.io/db" + "upper.io/db/mongo" - "upper.io/v2/db/mysql" - "upper.io/v2/db/postgresql" - "upper.io/v2/db/ql" - "upper.io/v2/db/sqlite" + "upper.io/db/mysql" + "upper.io/db/postgresql" + "upper.io/db/ql" + "upper.io/db/sqlite" ) var wrappers = []string{ diff --git a/mongo/README.md b/mongo/README.md index 3627fb228ec856f79b4233f77cf6ec5e345d7f63..ded918a24a60942dae3eea3bc135c390acce108f 100644 --- a/mongo/README.md +++ b/mongo/README.md @@ -1,6 +1,6 @@ -# MongoDB adapter for upper.io/v2/db +# MongoDB adapter for upper.io/db Please read the full docs, acknowledgements and examples at -[https://upper.io/v2/db/wrappers/mongo][1]. +[https://upper.io/db/wrappers/mongo][1]. -[1]: https://upper.io/v2/db/wrappers/mongo +[1]: https://upper.io/db/wrappers/mongo diff --git a/mongo/_example/main.go b/mongo/_example/main.go index b6635258c7c86f0cfeed7c06a736d5d4e8be0d49..88420f8557180d90ea5b6bc3b1eed0d94ec6a777 100644 --- a/mongo/_example/main.go +++ b/mongo/_example/main.go @@ -5,8 +5,8 @@ import ( "log" "time" - "upper.io/v2/db" // Imports the main db package. - _ "upper.io/v2/db/mongo" // Imports the mongo adapter. + "upper.io/db" // Imports the main db package. + _ "upper.io/db/mongo" // Imports the mongo adapter. ) var settings = db.Settings{ diff --git a/mongo/collection.go b/mongo/collection.go index ca0dfa36466b9cc2e3adcad3011594c7253e6736..df339a014f64098693ec87c89b2dcc52023cd5a5 100644 --- a/mongo/collection.go +++ b/mongo/collection.go @@ -30,7 +30,7 @@ import ( "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" - "upper.io/v2/db" + "upper.io/db" ) // Mongodb Collection diff --git a/mongo/connection.go b/mongo/connection.go index f0a7f9cb90aaf691d1713742c6bb6bd6d8eb4fbd..cb4917a0346170312d78c04f34063d20d321b4ae 100644 --- a/mongo/connection.go +++ b/mongo/connection.go @@ -26,7 +26,7 @@ import ( "net/url" "strings" - "upper.io/v2/db" + "upper.io/db" ) const connectionScheme = `mongodb` diff --git a/mongo/connection_test.go b/mongo/connection_test.go index 2ca33718fea6f5a2335b6667ca9f52722876302d..3e3f4328d0495e2e74d43c2f5a71ba374948288a 100644 --- a/mongo/connection_test.go +++ b/mongo/connection_test.go @@ -24,7 +24,7 @@ package mongo import ( "testing" - "upper.io/v2/db" + "upper.io/db" ) func TestConnectionURL(t *testing.T) { diff --git a/mongo/database.go b/mongo/database.go index bc1d4bf56e4ac4873c4c611c6aa7a45addb7e7cb..3e473c15db12ff855615f055677743076b4483be 100644 --- a/mongo/database.go +++ b/mongo/database.go @@ -19,7 +19,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -package mongo // import "upper.io/v2/db/mongo" +package mongo // import "upper.io/db/mongo" import ( "fmt" @@ -29,7 +29,7 @@ import ( "time" "gopkg.in/mgo.v2" - "upper.io/v2/db" + "upper.io/db" ) const Adapter = `mongo` diff --git a/mongo/database_test.go b/mongo/database_test.go index 8bfeef0961e12d1612e512df5fa616deff923efa..fe426bb7f2a3edcd4bde08a68e905968dde222ee 100644 --- a/mongo/database_test.go +++ b/mongo/database_test.go @@ -34,7 +34,7 @@ import ( "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "menteslibres.net/gosexy/to" - "upper.io/v2/db" + "upper.io/db" ) // Wrapper settings. diff --git a/mongo/result.go b/mongo/result.go index 5609815e238d0f0910b26df6440c86175616ccaa..8e6269b3575a7863f5a29c74a6a5ff0ccef24049 100644 --- a/mongo/result.go +++ b/mongo/result.go @@ -29,7 +29,7 @@ import ( "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" - "upper.io/v2/db" + "upper.io/db" ) type Result struct { diff --git a/mysql/README.md b/mysql/README.md index 6cdb62feefd25de2c66e190b1f7f4b95a10ea148..c2262cd3692ecb1a79203a5112c307213ca32eb8 100644 --- a/mysql/README.md +++ b/mysql/README.md @@ -1,7 +1,7 @@ -# MySQL adapter for upper.io/v2/db +# MySQL adapter for upper.io/db See the full docs, acknowledgements and examples at -[https://upper.io/v2/db/mysql][1] +[https://upper.io/db/mysql][1] -[1]: https://upper.io/v2/db/mysql +[1]: https://upper.io/db/mysql diff --git a/mysql/_example/main.go b/mysql/_example/main.go index f2248a65c4e35397f365fa202efd09aa16b12d08..fa4d20f651f9f24803f170596e1137a5f7615c7e 100644 --- a/mysql/_example/main.go +++ b/mysql/_example/main.go @@ -5,8 +5,8 @@ import ( "log" "time" - "upper.io/v2/db" // Imports the main db package. - _ "upper.io/v2/db/mysql" // Improts the mysql adapter. + "upper.io/db" // Imports the main db package. + _ "upper.io/db/mysql" // Improts the mysql adapter. ) var settings = db.Settings{ diff --git a/mysql/collection.go b/mysql/collection.go index 383bbb9fd62e24deefba91dee31218101b2cced4..d510642b72976d0a02435c5469ec4e54e08e6caf 100644 --- a/mysql/collection.go +++ b/mysql/collection.go @@ -25,10 +25,10 @@ import ( "database/sql" "strings" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/result" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/result" ) type table struct { diff --git a/mysql/connection.go b/mysql/connection.go index 68d583c5b8d23ec8945d0fb430a4361c961acaa5..faa3b4cfa8d925a5fcbb70aa23011c5ecdb67b29 100644 --- a/mysql/connection.go +++ b/mysql/connection.go @@ -26,7 +26,7 @@ import ( "net/url" "strings" - "upper.io/v2/db" + "upper.io/db" ) const defaultPort = 3306 diff --git a/mysql/connection_test.go b/mysql/connection_test.go index f700c9e6f1058f9371d6cbf197dd0209229931b1..1e833d1e674eb5f039f405df06e52e49416db8ef 100644 --- a/mysql/connection_test.go +++ b/mysql/connection_test.go @@ -24,7 +24,7 @@ package mysql import ( "testing" - "upper.io/v2/db" + "upper.io/db" ) func TestConnectionURL(t *testing.T) { diff --git a/mysql/database.go b/mysql/database.go index 8bcb7ebb646f0614358950b382095c7ccd4690da..df840b2221f2bc1dbf52cf8e0fec1841d3fc8b48 100644 --- a/mysql/database.go +++ b/mysql/database.go @@ -28,11 +28,11 @@ import ( _ "github.com/go-sql-driver/mysql" // MySQL driver. "github.com/jmoiron/sqlx" - "upper.io/v2/db" - "upper.io/v2/db/util/schema" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/tx" + "upper.io/db" + "upper.io/db/util/schema" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/tx" ) var ( diff --git a/mysql/database_test.go b/mysql/database_test.go index f3c9cc78eaedf6e50b6f6f853e0354bf5d8fcc5e..5fd4d163a2c2ee687261c1b666fdc5d3950cadbf 100644 --- a/mysql/database_test.go +++ b/mysql/database_test.go @@ -35,8 +35,8 @@ import ( "github.com/jmoiron/sqlx" "menteslibres.net/gosexy/to" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlutil" ) const ( diff --git a/mysql/mysql.go b/mysql/mysql.go index 9d48672a576bd9a4138bf5661f37bcfa300677ec..c6791206ad6f5a1cb9e5dcacfe0c421ceede2334 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -19,13 +19,13 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -package mysql // import "upper.io/v2/db/mysql" +package mysql // import "upper.io/db/mysql" import ( "upper.io/cache" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" ) // Adapter is the public name of the adapter. diff --git a/postgresql/README.md b/postgresql/README.md index 2c1e720130338f7d83ad14bdb169f1f338676d58..f374a92b187845718474af6de4c985a6f953b10a 100644 --- a/postgresql/README.md +++ b/postgresql/README.md @@ -1,6 +1,6 @@ -# PostgreSQL adapter for upper.io/v2/db +# PostgreSQL adapter for upper.io/db Please read the full docs, acknowledgements and examples at -[https://upper.io/v2/db/postgresql][1] +[https://upper.io/db/postgresql][1] -[1]: https://upper.io/v2/db/postgresql +[1]: https://upper.io/db/postgresql diff --git a/postgresql/_example/main.go b/postgresql/_example/main.go index a1e916065e120ae0875f389ae40da445ab7f7c23..6377714527ccd11eaf5c562b95b1f721c30161cd 100644 --- a/postgresql/_example/main.go +++ b/postgresql/_example/main.go @@ -5,8 +5,8 @@ import ( "log" "time" - "upper.io/v2/db" // Imports the main db package. - _ "upper.io/v2/db/postgresql" // Imports the postgresql adapter. + "upper.io/db" // Imports the main db package. + _ "upper.io/db/postgresql" // Imports the postgresql adapter. ) var settings = db.Settings{ diff --git a/postgresql/collection.go b/postgresql/collection.go index 5f10d9f7f16748ce5bb794436ceca621d4b10f52..0158c17dd6f8b646cc5a94e685a46dfbb4e725b0 100644 --- a/postgresql/collection.go +++ b/postgresql/collection.go @@ -27,10 +27,10 @@ import ( "strings" "github.com/jmoiron/sqlx" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/result" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/result" ) type table struct { diff --git a/postgresql/connection.go b/postgresql/connection.go index 4758a902ae6acfe43da422e7f5344252600bcc33..451383ce96af9a707eb03d9e354405127da4aeca 100644 --- a/postgresql/connection.go +++ b/postgresql/connection.go @@ -28,7 +28,7 @@ import ( "unicode" "github.com/lib/pq" - "upper.io/v2/db" + "upper.io/db" ) // scanner implements a tokenizer for libpq-style option strings. diff --git a/postgresql/connection_test.go b/postgresql/connection_test.go index 2600b613081af81d50cfeee78531914bcbc5ed24..dd6cc0d1c9aae2b22abae7d8c493b886bc9f74c8 100644 --- a/postgresql/connection_test.go +++ b/postgresql/connection_test.go @@ -24,7 +24,7 @@ package postgresql import ( "testing" - "upper.io/v2/db" + "upper.io/db" ) func TestConnectionURL(t *testing.T) { diff --git a/postgresql/database.go b/postgresql/database.go index 4a03989b579d2c23fb0f0e5f0df61e9427e62527..a95c014c567687ee94704e32e9294f79f1dd93db 100644 --- a/postgresql/database.go +++ b/postgresql/database.go @@ -30,11 +30,11 @@ import ( "github.com/jmoiron/sqlx" _ "github.com/lib/pq" // PostgreSQL driver. - "upper.io/v2/db" - "upper.io/v2/db/util/schema" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/tx" + "upper.io/db" + "upper.io/db/util/schema" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/tx" ) var ( diff --git a/postgresql/database_test.go b/postgresql/database_test.go index 45f0b81855bd73a6774ffb1f41b699372c0903b0..1dc7c3ca48bf8f22d30f55400b7ff81c8016be0d 100644 --- a/postgresql/database_test.go +++ b/postgresql/database_test.go @@ -35,8 +35,8 @@ import ( "math/rand" "github.com/jmoiron/sqlx" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlutil" ) const ( diff --git a/postgresql/postgresql.go b/postgresql/postgresql.go index f15ef8703a0ba6e31001e4d63960fee0e6088437..9f4a90e515a31ab20e2bd0b08fdec7278f4e55a5 100644 --- a/postgresql/postgresql.go +++ b/postgresql/postgresql.go @@ -19,13 +19,13 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -package postgresql // import "upper.io/v2/db/postgresql" +package postgresql // import "upper.io/db/postgresql" import ( "upper.io/cache" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" ) // Adapter is the public name of the adapter. diff --git a/ql/_example/main.go b/ql/_example/main.go index 33a1c75fb18aec7ba7b49881ff6d056d19067196..297caef56d00518a898a1cbf1e4b1e84658e88b0 100644 --- a/ql/_example/main.go +++ b/ql/_example/main.go @@ -5,8 +5,8 @@ import ( "log" "time" - "upper.io/v2/db" // Imports the main db package. - _ "upper.io/v2/db/ql" // Imports the ql adapter. + "upper.io/db" // Imports the main db package. + _ "upper.io/db/ql" // Imports the ql adapter. ) var settings = db.Settings{ diff --git a/ql/collection.go b/ql/collection.go index 68b9cb3b7837bfcabb423b5c64220b0e9069a9df..53a5d4c1b7e98e0237a9a42278ab7973bda83495 100644 --- a/ql/collection.go +++ b/ql/collection.go @@ -26,10 +26,10 @@ import ( "reflect" "strings" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/result" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/result" ) type table struct { diff --git a/ql/database.go b/ql/database.go index 0892610d2c5ee1bac9df035c95077eb27f6a3992..c6529044b60e1aca67f8371c3ae32a918d262eb0 100644 --- a/ql/database.go +++ b/ql/database.go @@ -29,11 +29,11 @@ import ( _ "github.com/cznic/ql/driver" // QL driver "github.com/jmoiron/sqlx" - "upper.io/v2/db" - "upper.io/v2/db/util/schema" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/tx" + "upper.io/db" + "upper.io/db/util/schema" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/tx" ) var ( diff --git a/ql/database_test.go b/ql/database_test.go index 861dfedfe5184284edbc3d58e64526774640a44a..bc97d1676d2f3a8cb51d0a2a2e4fde554f82a787 100644 --- a/ql/database_test.go +++ b/ql/database_test.go @@ -41,8 +41,8 @@ import ( "time" "github.com/jmoiron/sqlx" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlutil" ) const ( diff --git a/ql/ql.go b/ql/ql.go index ce4749546fe45045e70e5354d0d0567a01013312..c8c3701111f697a54bee32bce28310ce8c5f29cb 100644 --- a/ql/ql.go +++ b/ql/ql.go @@ -19,13 +19,13 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -package ql // import "upper.io/v2/db/ql" +package ql // import "upper.io/db/ql" import ( "upper.io/cache" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" ) // Adapter is the public name of the adapter. diff --git a/sqlite/README.md b/sqlite/README.md index 747a79d69b9e8385e7c349957898e891be9fe599..1c604de95e674c145b95bdeedf6d8bb2609a577f 100644 --- a/sqlite/README.md +++ b/sqlite/README.md @@ -1,6 +1,6 @@ -# SQLite3 adapter for upper.io/v2/db +# SQLite3 adapter for upper.io/db Please read the full docs, acknowledgements and examples at -[https://upper.io/v2/db/sqlite][1] +[https://upper.io/db/sqlite][1] -[1]: https://upper.io/v2/db/sqlite +[1]: https://upper.io/db/sqlite diff --git a/sqlite/_example/main.go b/sqlite/_example/main.go index 905961402bc419fe43dc6d779620672fde9bd7ed..0c5e1541cd4678b9771c872e7bcd06a86bb3161e 100644 --- a/sqlite/_example/main.go +++ b/sqlite/_example/main.go @@ -5,8 +5,8 @@ import ( "log" "time" - "upper.io/v2/db" // Imports the main db package. - _ "upper.io/v2/db/sqlite" // Imports the sqlite adapter. + "upper.io/db" // Imports the main db package. + _ "upper.io/db/sqlite" // Imports the sqlite adapter. ) var settings = db.Settings{ diff --git a/sqlite/collection.go b/sqlite/collection.go index aa9c63d30b4aae492f289b36fdd2c2bc0e9e0fdc..0aadfcd010ce8ae64d1e4ce1bc6321b3d69bd9c4 100644 --- a/sqlite/collection.go +++ b/sqlite/collection.go @@ -26,10 +26,10 @@ import ( "database/sql" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/result" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/result" ) type table struct { diff --git a/sqlite/database.go b/sqlite/database.go index 71f76e0761198ba464bf001e39d91e0a740c1a37..22de80bb25b0fbb068dfe720649e18137d903a95 100644 --- a/sqlite/database.go +++ b/sqlite/database.go @@ -29,11 +29,11 @@ import ( "github.com/jmoiron/sqlx" _ "github.com/mattn/go-sqlite3" // SQLite3 driver. - "upper.io/v2/db" - "upper.io/v2/db/util/schema" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" - "upper.io/v2/db/util/sqlutil/tx" + "upper.io/db" + "upper.io/db/util/schema" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" + "upper.io/db/util/sqlutil/tx" ) var ( diff --git a/sqlite/database_test.go b/sqlite/database_test.go index ba54503e0381b4681316c3177201d8a222b607cc..e2296452827f52cde10a5929a470b7735baa2927 100644 --- a/sqlite/database_test.go +++ b/sqlite/database_test.go @@ -42,8 +42,8 @@ import ( "github.com/jmoiron/sqlx" "menteslibres.net/gosexy/to" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlutil" ) const ( diff --git a/sqlite/sqlite.go b/sqlite/sqlite.go index 8ad04fa82325fbfd599cdf1ddb527fb800e6e0a0..eb423e2aeae23c28b9b3a027cb4e4218496cbe15 100644 --- a/sqlite/sqlite.go +++ b/sqlite/sqlite.go @@ -19,13 +19,13 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -package sqlite // import "upper.io/v2/db/sqlite" +package sqlite // import "upper.io/db/sqlite" import ( "upper.io/cache" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" ) // Adapter is the public name of the adapter. diff --git a/util/sqlutil/convert.go b/util/sqlutil/convert.go index 96f2c552c0362aaf476588492190e03d4eee9fb8..d7bc224c8e75bf632986ed8ea87513644dc238e0 100644 --- a/util/sqlutil/convert.go +++ b/util/sqlutil/convert.go @@ -4,8 +4,8 @@ import ( "fmt" "reflect" "strings" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" + "upper.io/db" + "upper.io/db/util/sqlgen" ) var ( diff --git a/util/sqlutil/debug.go b/util/sqlutil/debug.go index eef4baf6bae4f3446181734ef3117499806e7cc2..f82a98577de0c1eef0661aedbda9050c62e31413 100644 --- a/util/sqlutil/debug.go +++ b/util/sqlutil/debug.go @@ -27,7 +27,7 @@ import ( "os" "strings" - "upper.io/v2/db" + "upper.io/db" ) // Debug is used for printing SQL queries and arguments. diff --git a/util/sqlutil/fetch.go b/util/sqlutil/fetch.go index 9d1e1bc2b317247ee7da8aab2e1a2f76c0ef5139..13053d1da2e20b147cfa91df79b855a736040ce6 100644 --- a/util/sqlutil/fetch.go +++ b/util/sqlutil/fetch.go @@ -27,7 +27,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx/reflectx" - "upper.io/v2/db" + "upper.io/db" ) // FetchRow receives a *sqlx.Rows value and tries to map all the rows into a diff --git a/util/sqlutil/result/result.go b/util/sqlutil/result/result.go index 2426cead30b2d4373f8ed71ac35b634a1d6efc34..7badb0e750e2774ff0f511bb1018cccd8b624813 100644 --- a/util/sqlutil/result/result.go +++ b/util/sqlutil/result/result.go @@ -26,9 +26,9 @@ import ( "strings" "github.com/jmoiron/sqlx" - "upper.io/v2/db" - "upper.io/v2/db/util/sqlgen" - "upper.io/v2/db/util/sqlutil" + "upper.io/db" + "upper.io/db/util/sqlgen" + "upper.io/db/util/sqlutil" ) var ( diff --git a/util/sqlutil/result/table.go b/util/sqlutil/result/table.go index 0984adcd966fc94f3fc1f576688dc1093979f468..57ec42ac1bdf8abe90ea0667e7b8177089820c8d 100644 --- a/util/sqlutil/result/table.go +++ b/util/sqlutil/result/table.go @@ -3,7 +3,7 @@ package result import ( "database/sql" "github.com/jmoiron/sqlx" - "upper.io/v2/db/util/sqlgen" + "upper.io/db/util/sqlgen" ) type DataProvider interface { diff --git a/util/sqlutil/scanner.go b/util/sqlutil/scanner.go index 270a501c31fde98a29a0571b26e4ce2c76d10ca8..34bde7a0fe4fc2b2b8db6d9c6f32c9bda48cd132 100644 --- a/util/sqlutil/scanner.go +++ b/util/sqlutil/scanner.go @@ -29,7 +29,7 @@ import ( "strconv" "strings" - "upper.io/v2/db" + "upper.io/db" ) type scanner struct { diff --git a/util/sqlutil/sqlutil.go b/util/sqlutil/sqlutil.go index 9b3ed2b4e90f4b534938c22a08eba01d3bd2d692..4d2b54df5b3074dafa2e02561e149061c340be1e 100644 --- a/util/sqlutil/sqlutil.go +++ b/util/sqlutil/sqlutil.go @@ -29,7 +29,7 @@ import ( "strings" "github.com/jmoiron/sqlx/reflectx" - "upper.io/v2/db" + "upper.io/db" ) var ( diff --git a/wrapper.go b/wrapper.go index 8e3d01afd36bedfb014c674d6608c60bef8557eb..058cf6904532451ae4392250a7904f594efb8a39 100644 --- a/wrapper.go +++ b/wrapper.go @@ -53,7 +53,7 @@ func Open(adapter string, conn ConnectionURL) (Database, error) { if ok == false { // Using panic instead of returning error because attemping to use an // adapter that does not exists will never result in success. - panic(fmt.Sprintf(`Open: Unknown adapter %s. (see: https://upper.io/v2/db#database-adapters)`, adapter)) + panic(fmt.Sprintf(`Open: Unknown adapter %s. (see: https://upper.io/db#database-adapters)`, adapter)) } // Creating a new connection everytime Open() is called.