|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| .github/workflows/ | H | 09-Jan-2021 | - | 43 | 32 |
| _examples/booktown-books/ | H | 09-Jan-2021 | - | 40 | 32 |
| internal/ | H | 09-Jan-2021 | - | 10,359 | 7,683 |
| lib/ | H | 09-Jan-2021 | - | 6,850 | 5,050 |
| mongo/ | H | 09-Jan-2021 | - | 2,402 | 1,627 |
| mssql/ | H | 09-Jan-2021 | - | 1,562 | 1,036 |
| mysql/ | H | 09-Jan-2021 | - | 2,507 | 1,686 |
| postgresql/ | H | 09-Jan-2021 | - | 3,616 | 2,577 |
| ql/ | H | 09-Jan-2021 | - | 1,502 | 998 |
| sqlite/ | H | 09-Jan-2021 | - | 1,518 | 997 |
| .gitignore | H A D | 09-Jan-2021 | 32 | 5 | 4 |
| CHANGELOG.md | H A D | 09-Jan-2021 | 742 | 32 | 20 |
| LICENSE | H A D | 09-Jan-2021 | 1.1 KiB | 21 | 16 |
| Makefile | H A D | 09-Jan-2021 | 929 | 51 | 36 |
| README.md | H A D | 09-Jan-2021 | 3.7 KiB | 128 | 99 |
| collection.go | H A D | 09-Jan-2021 | 2.7 KiB | 61 | 10 |
| comparison.go | H A D | 09-Jan-2021 | 8 KiB | 335 | 196 |
| compound.go | H A D | 09-Jan-2021 | 3.4 KiB | 132 | 78 |
| cond.go | H A D | 09-Jan-2021 | 3.1 KiB | 111 | 49 |
| cond_test.go | H A D | 09-Jan-2021 | 867 | 70 | 50 |
| connection_url.go | H A D | 09-Jan-2021 | 1.3 KiB | 30 | 4 |
| constraint.go | H A D | 09-Jan-2021 | 2.3 KiB | 68 | 26 |
| database.go | H A D | 09-Jan-2021 | 2.4 KiB | 67 | 13 |
| db.go | H A D | 09-Jan-2021 | 2.4 KiB | 75 | 1 |
| env.go | H A D | 09-Jan-2021 | 1.3 KiB | 35 | 11 |
| errors.go | H A D | 09-Jan-2021 | 3.1 KiB | 53 | 28 |
| function.go | H A D | 09-Jan-2021 | 2.1 KiB | 68 | 19 |
| function_test.go | H A D | 09-Jan-2021 | 1.1 KiB | 52 | 42 |
| intersection.go | H A D | 09-Jan-2021 | 2.3 KiB | 73 | 23 |
| logger.go | H A D | 09-Jan-2021 | 3.9 KiB | 147 | 83 |
| marshal.go | H A D | 09-Jan-2021 | 1.7 KiB | 38 | 7 |
| raw.go | H A D | 09-Jan-2021 | 2.7 KiB | 96 | 43 |
| result.go | H A D | 09-Jan-2021 | 6.8 KiB | 192 | 27 |
| settings.go | H A D | 09-Jan-2021 | 5 KiB | 192 | 112 |
| tx.go | H A D | 09-Jan-2021 | 1.4 KiB | 32 | 5 |
| union.go | H A D | 09-Jan-2021 | 2 KiB | 64 | 23 |
| wrapper.go | H A D | 09-Jan-2021 | 2.5 KiB | 82 | 45 |
README.md
1<p align="center">
2 <img src="https://upper.io/db.v3/images/gopher.svg" width="256" />
3</p>
4
5# upper.io/db.v3 [![Build Status](https://travis-ci.org/upper/db.svg?branch=master)](https://travis-ci.org/upper/db) [![GoDoc](https://godoc.org/upper.io/db.v3?status.svg)](https://godoc.org/upper.io/db.v3)
6
7The `upper.io/db.v3` package for [Go][2] is a productive data access layer for
8Go that provides a common interface to work with different data sources such as
9[PostgreSQL](https://upper.io/db.v3/postgresql),
10[MySQL](https://upper.io/db.v3/mysql), [SQLite](https://upper.io/db.v3/sqlite),
11[MSSQL](https://upper.io/db.v3/mssql),
12[QL](https://upper.io/db.v3/ql) and [MongoDB](https://upper.io/db.v3/mongo).
13
14```
15go get upper.io/db.v3
16```
17
18## The tour
19
20![screen shot 2017-05-01 at 19 23 22](https://cloud.githubusercontent.com/assets/385670/25599675/b6fe9fea-2ea3-11e7-9f76-002931dfbbc1.png)
21
22Take the [tour](https://tour.upper.io) to see real live examples in your
23browser.
24
25## Live demos
26
27You can run the following example on our [playground](https://demo.upper.io):
28
29```go
30package main
31
32import (
33 "log"
34
35 "upper.io/db.v3/postgresql"
36)
37
38var settings = postgresql.ConnectionURL{
39 Host: "demo.upper.io",
40 Database: "booktown",
41 User: "demouser",
42 Password: "demop4ss",
43}
44
45type Book struct {
46 ID int `db:"id"`
47 Title string `db:"title"`
48 AuthorID int `db:"author_id"`
49 SubjectID int `db:"subject_id"`
50}
51
52func main() {
53 sess, err := postgresql.Open(settings)
54 if err != nil {
55 log.Fatalf("db.Open(): %q\n", err)
56 }
57 defer sess.Close()
58
59 var books []Book
60 err = sess.Collection("books").Find().All(&books)
61 if err != nil {
62 log.Fatalf("Find(): %q\n", err)
63 }
64
65 for i, book := range books {
66 log.Printf("Book %d: %#v\n", i, book)
67 }
68}
69```
70
71Or you can also run it locally from the `_examples` directory:
72
73```
74go run _examples/booktown-books/main.go
752016/08/10 08:42:48 "The Shining" (ID: 7808)
762016/08/10 08:42:48 "Dune" (ID: 4513)
772016/08/10 08:42:48 "2001: A Space Odyssey" (ID: 4267)
782016/08/10 08:42:48 "The Cat in the Hat" (ID: 1608)
792016/08/10 08:42:48 "Bartholomew and the Oobleck" (ID: 1590)
802016/08/10 08:42:48 "Franklin in the Dark" (ID: 25908)
812016/08/10 08:42:48 "Goodnight Moon" (ID: 1501)
822016/08/10 08:42:48 "Little Women" (ID: 190)
832016/08/10 08:42:48 "The Velveteen Rabbit" (ID: 1234)
842016/08/10 08:42:48 "Dynamic Anatomy" (ID: 2038)
852016/08/10 08:42:48 "The Tell-Tale Heart" (ID: 156)
862016/08/10 08:42:48 "Programming Python" (ID: 41473)
872016/08/10 08:42:48 "Learning Python" (ID: 41477)
882016/08/10 08:42:48 "Perl Cookbook" (ID: 41478)
892016/08/10 08:42:48 "Practical PostgreSQL" (ID: 41472)
90```
91
92## Documentation for users
93
94This is the source code repository, check out our [release
95notes](https://github.com/upper/db/releases/tag/v3.0.0) and see examples and
96documentation at [upper.io/db.v3][1].
97
98
99## Changelog
100
101See [CHANGELOG.md](https://github.com/upper/db/blob/master/CHANGELOG.md).
102
103## License
104
105Licensed under [MIT License](./LICENSE)
106
107## Authors and contributors
108
109* José Carlos Nieto <<jose.carlos@menteslibres.net>>
110* Peter Kieltyka <<peter@pressly.com>>
111* Maciej Lisiewski <<maciej.lisiewski@gmail.com>>
112* Max Hawkins <<maxhawkins@google.com>>
113* Paul Xue <<paul.xue@pressly.com>>
114* Kevin Darlington <<kdarlington@gmail.com>>
115* Lars Buitinck <<l.buitinck@esciencecenter.nl>>
116* icattlecoder <<icattlecoder@gmail.com>>
117* Aaron <<aaron.l.france@gmail.com>>
118* Hiram J. Pérez <<worg@linuxmail.org>>
119* Julien Schmidt <<github@julienschmidt.com>>
120* Max Hawkins <<maxhawkins@gmail.com>>
121* Piotr "Orange" Zduniak <<piotr@zduniak.net>>
122* achun <<achun.shx@qq.com>>
123* rjmcguire <<rjmcguire@gmail.com>>
124* wei2912 <<wei2912_support@hotmail.com>>
125
126[1]: https://upper.io/db.v3
127[2]: http://golang.org
128