<commit_before># Cockroach ORM examples

This repo contains example uses of CockroachDB with popular ORMs.
Each example will implement the [sample application](#sample-app)
spec presented below.

See the [CockroachDB ORM Compatibility Plan](https://docs.google.com/a/cockroachlabs.com/spreadsheets/d/17A0EflPqI9yhargK0n4tSw2WogQuVc5YeK-VFmKvXHM/edit?usp=sharing)
for a roadmap towards supporting various ORMs.

## Testing

To run automated testing against all ORMs using the latest binary of CockroachDB,
simply run:

```
make test
```

To run automated testing against all ORMs using a custom CockroachDB binary, run:

```
make test COCKROACH_BINARY=/path/to/binary/cockroach
```

## Project Structure

The repository contains a set of directories named after programming<commit_msg>Update README with install instructions<commit_after># Cockroach ORM examples

This repo contains example uses of CockroachDB with popular ORMs.
Each example will implement the [sample application](#sample-app)
spec presented below.

See the [CockroachDB ORM Compatibility Plan](https://docs.google.com/a/cockroachlabs.com/spreadsheets/d/17A0EflPqI9yhargK0n4tSw2WogQuVc5YeK-VFmKvXHM/edit?usp=sharing)
for a roadmap towards supporting various ORMs.

## Installation

Clone this repo into your `$GOPATH` manually, e.g.,

```bash
$ cd ~/go/src/github.com/cockroachdb
$ git clone https://github.com/cockroachdb/examples-orms
```

This is required because this project uses Go to drive the automated tests, so it will look for things in your `$GOPATH`.  If you try to clone it to a non-`$GOPATH` directory, it will fail roughly as follows:

```bash
$ cd ~/some/random/dir/examples-orms
$ make test
go test -v -i ./testing
testing/api_handler.go:13:2: cannot find package "github.com/cockroachdb/examples-orms/go/gorm/model" in any of:
	/usr/local/Cellar/go/1.10/libexec/src/github.com/cockroachdb/examples-orms/go/gorm/model (from $GOROOT)
	/Users/rloveland/go/src/github.com/cockroachdb/examples-orms/go/gorm/model (from $GOPATH)
testing/api_handler.go:11:2: cannot find package "github.com/pkg/errors" in any of:
	/usr/local/Cellar/go/1.10/libexec/src/github.com/pkg/errors (from $GOROOT)
	/Users/rloveland/go/src/github.com/pkg/errors (from $GOPATH)
make: *** [test] Error 1
```

However, this is not actually a Go project, so `go get -d` will also fail (hence the need to manually clone).

```bash
$ go get -d github.com/cockroachdb/examples-orms
package github.com/cockroachdb/examples-orms: no Go files in /Users/rloveland/go/src/github.com/cockroachdb/examples-orms
```

## Testing

To run automated testing against all ORMs using the latest binary of CockroachDB, run:

```bash
$ make test
```

To run automated testing against all ORMs using a custom CockroachDB binary, run:

```bash
$ make test COCKROACH_BINARY=/path/to/binary/cockroach
```

## Project Structure

The repository contains a set of directories named after programming
{'fraction_non_alphanumeric': 0.10297639411563463, 'fraction_numerical': 0.009921313718782073, 'mean_word_length': 4.895161290322581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7159573', 'n_tokens_mistral': 1047, 'n_tokens_neox': 977, 'n_words': 300}