Skip to content

Commit

Permalink
Merge branch 'organize'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoiron committed Jun 2, 2013
2 parents e9e1027 + 2cbbb9c commit 61a8d37
Show file tree
Hide file tree
Showing 11 changed files with 861 additions and 1,168 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ _obj
*~
*.6
6.out
environ
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
# Go Relational Persistence #
# Go Relational Persistence

[![Build Status](https://drone.io/github.com/jmoiron/gorp/status.png)](https://drone.io/github.com/jmoiron/gorp/latest)

**Note**: This fork is under heavy development. I plan to discuss the reasons
for this fork and some of the guiding philosophies behind what's been added and
what's been removed. For now, read the todo.md in this directory.

To use the `test-all` script, set the following environment variables:

```sh
# mysql DSN, like "gorptest/gorptest/gorptest"
GORP_MYSQL_DSN="dbname/username/password"

# postgres DSN, like:
GORP_POSTGRES_DSN="username=dbname password=pw dbname=dbname ssl-node=disable"

# sqlite DSN, which is a path
GORP_SQLITE_DSN="/dev/shm/gorptest.db"

# optional, will fail the test if any DBs are skipped (for CI, mostly)
GORP_FAIL_ON_SKIP=true
```

In addition to this, you can create an `environ` file in this directory which
will be sourced and ignored by git. You can continue to use the `GORP_TEST_DSN`
and `GORP_TEST_DIALECT` variables if you want to manually run `go test` or if
you want to run the benchmarks, as described below.

The original README.md follows:


---------------------------------------------------------------------

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
Expand Down
30 changes: 30 additions & 0 deletions bench_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

#set -e

export GORP_TEST_DSN="gorptest/gorptest/"
export GORP_TEST_DIALECT="mysql"
go test -bench . -benchmem

export GORP_TEST_DSN="user=$USER dbname=gorptest sslmode=disable"
export GORP_TEST_DIALECT="postgres"
go test -bench . -benchmem

export GORP_TEST_DSN="/tmp/gorptest.bin"
export GORP_TEST_DIALECT="sqlite"
go test -bench . -benchmem

# PASS
# BenchmarkNativeCrud 2000 872061 ns/op 5364 B/op 106 allocs/op
# BenchmarkGorpCrud 2000 918331 ns/op 7257 B/op 159 allocs/op
# ok _/Users/jmoiron/dev/go/gorp 4.413s
# PASS
# BenchmarkNativeCrud 1000 1468223 ns/op 8833 B/op 335 allocs/op
# BenchmarkGorpCrud 1000 1485000 ns/op 11585 B/op 390 allocs/op
# ok _/Users/jmoiron/dev/go/gorp 3.664s
# PASS
# BenchmarkNativeCrud 1000 1761324 ns/op 1446 B/op 51 allocs/op
# BenchmarkGorpCrud 1000 1733306 ns/op 2942 B/op 99 allocs/op
# ok _/Users/jmoiron/dev/go/gorp 3.977s
#

Loading

0 comments on commit 61a8d37

Please sign in to comment.