You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently cleaning up the backlog of issues and PR's. When this is done the codebase will be split into separate files and there will be breaking changes to the API's. We're also adding better tests and documentation. As a result of these changes the `master` branch will be unstable. Please use `gopkg.in/gorp.v1`. When the cleanup and changes are done, we will release `v2.0`.
12
+
As many of the maintainers have become busy with other projects,
13
+
progress toward the ever-elusive v2 has slowed to the point that we're
14
+
only occasionally making progress outside of merging pull requests.
15
+
In the interest of continuing to release, I'd like to lean toward a
16
+
more maintainable path forward.
12
17
13
-
At this time we won't accept new feature-related pull-requests because of changes to the codebase. Please create an issue for your feature and wait until `v2.0` has been released.
14
-
15
-
For more information, please read [#270](https://github.com/go-gorp/gorp/issues/270).
18
+
For the moment, I am releasing a v2 tag with the current feature set
19
+
from master, as some of those features have been actively used and
20
+
relied on by more than one project. Our next goal is to continue
21
+
cleaning up the code base with non-breaking changes as much as
22
+
possible, but if/when a breaking change is needed, we'll just release
23
+
new versions. This allows us to continue development at whatever pace
24
+
we're capable of, without delaying the release of features or refusing
25
+
PRs.
16
26
17
27
## Introduction
18
28
19
-
I hesitate to call gorp an ORM. Go doesn't really have objects, at least not in the classic Smalltalk/Java sense. There goes the "O". gorp doesn't know anything about the relationships between your structs (at least not yet). So the "R" is questionable too (but I use it in the name because, well, it seemed more clever).
29
+
I hesitate to call gorp an ORM. Go doesn't really have objects, at
30
+
least not in the classic Smalltalk/Java sense. There goes the "O".
31
+
gorp doesn't know anything about the relationships between your
32
+
structs (at least not yet). So the "R" is questionable too (but I use
33
+
it in the name because, well, it seemed more clever).
20
34
21
-
The "M" is alive and well. Given some Go structs and a database, gorp should remove a fair amount of boilerplate busy-work from your code.
35
+
The "M" is alive and well. Given some Go structs and a database, gorp
36
+
should remove a fair amount of boilerplate busy-work from your code.
22
37
23
-
I hope that gorp saves you time, minimizes the drudgery of getting data in and out of your database, and helps your code focus on algorithms, not infrastructure.
38
+
I hope that gorp saves you time, minimizes the drudgery of getting
39
+
data in and out of your database, and helps your code focus on
40
+
algorithms, not infrastructure.
24
41
25
42
* Bind struct fields to table columns via API or tag
26
43
* Support for embedded structs
@@ -35,42 +52,59 @@ I hope that gorp saves you time, minimizes the drudgery of getting data in and o
35
52
* Bind arbitrary SQL queries to a struct
36
53
* Bind slice to SELECT query results without type assertions
37
54
* Use positional or named bind parameters in custom SELECT queries
38
-
* Optional optimistic locking using a version column (for update/deletes)
55
+
* Optional optimistic locking using a version column (for
56
+
update/deletes)
39
57
40
58
## Installation
41
59
42
-
# install the library:
43
-
go get gopkg.in/gorp.v1
44
-
45
-
// use in your .go code:
46
-
import (
47
-
"gopkg.in/gorp.v1"
48
-
)
60
+
Use `go get` or your favorite vendoring tool, using whichever import
61
+
path you'd like.
49
62
50
63
## Versioning
51
64
52
-
This project provides a stable release (v1.x tags) and a bleeding edge codebase (master).
65
+
We use semantic version tags. Feel free to import through `gopkg.in`
66
+
(e.g. `gopkg.in/gorp.v2`) to get the latest tag for a major version,
67
+
or check out the tag using your favorite vendoring tool.
53
68
54
-
`gopkg.in/gorp.v1` points to the latest v1.x tag. The API's for v1 are stable and shouldn't change. Development takes place at the master branch. Althought the code in master should always compile and test successfully, it might break API's. We aim to maintain backwards compatibility, but API's and behaviour might be changed to fix a bug. Also note that API's that are new in the master branch can change until released as v2.
69
+
Development is not very active right now, but we have plans to
70
+
restructure `gorp` as we continue to move toward a more extensible
71
+
system. Whenever a breaking change is needed, the major version will
72
+
be bumped.
55
73
56
-
If you want to use bleeding edge, use `github.com/go-gorp/gorp` as import path.
74
+
The `master` branch is where all development is done, and breaking
75
+
changes may happen from time to time. That said, if you want to live
76
+
on the bleeding edge and are comfortable updating your code when we
77
+
make a breaking change, you may use `github.com/go-gorp/gorp` as your
78
+
import path.
57
79
58
-
## API Documentation
80
+
Check the version tags to see what's available. We'll make a good
81
+
faith effort to add badges for new versions, but we make no
82
+
guarantees.
59
83
60
-
Full godoc output from the latest v1 release is available here:
84
+
## Supported Go versions
61
85
62
-
https://godoc.org/gopkg.in/gorp.v1
86
+
This package is guaranteed to be compatible with the latest 2 major
87
+
versions of Go.
63
88
64
-
For the latest code in master:
89
+
Any earlier versions are only supported on a best effort basis and can
90
+
be dropped any time. Go has a great compatibility promise. Upgrading
91
+
your program to a newer version of Go should never really be a
"gomysql"(for go-sql-driver), "postgres", "sqlite" See the
760
+
`test_all.sh` script for examples of all 3 databases. This is the
761
+
script I run locally to test the library.
715
762
716
763
## Performance
717
764
718
-
gorp uses reflection to construct SQL queries and bind parameters. See the BenchmarkNativeCrud vs BenchmarkGorpCrud in gorp_test.go for a simple perf test. On my MacBook Pro gorp is about 2-3% slower than hand written SQL.
719
-
720
-
## Migration guide
721
-
#### Pre-v2 to v2
722
-
Automatic mapping of the version column used in optimistic locking has been removed as it could cause problems if the type was not int. The version column must now explicitly be set with tablemap.SetVersionCol().
723
-
724
-
## Help/Support
725
-
726
-
IRC: #gorp
727
-
Mailing list: gorp-dev@googlegroups.com
728
-
Bugs/Enhancements: Create a github issue
729
-
730
-
## Pull requests / Contributions
731
-
732
-
Contributions are very welcome. Please follow these guidelines:
733
-
734
-
* Fork the `master` branch and issue pull requests targeting the `master` branch
735
-
* If you are adding an enhancement, please open an issue first with your proposed change.
736
-
* Changes that break backwards compatibility in the public API are only accepted after we
737
-
discuss on a GitHub issue for a while.
765
+
gorp uses reflection to construct SQL queries and bind parameters.
766
+
See the BenchmarkNativeCrud vs BenchmarkGorpCrud in gorp_test.go for a
767
+
simple perf test. On my MacBook Pro gorp is about 2-3% slower than
0 commit comments