https://github.com/altipla-consulting/arrays
Models for integer and string arrays in MySQL.
https://github.com/altipla-consulting/arrays
database mysql
Last synced: 6 months ago
JSON representation
Models for integer and string arrays in MySQL.
- Host: GitHub
- URL: https://github.com/altipla-consulting/arrays
- Owner: altipla-consulting
- License: mit
- Archived: true
- Created: 2017-11-04T14:38:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-29T14:42:29.000Z (over 7 years ago)
- Last Synced: 2024-06-20T17:48:10.285Z (about 2 years ago)
- Topics: database, mysql
- Language: Go
- Homepage: https://github.com/altipla-consulting/arrays
- Size: 10.7 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arrays
> **DEPRECATED:** Use https://github.com/altipla-consulting/libs instead.
[](https://godoc.org/github.com/altipla-consulting/arrays)
Models for integer and string arrays in MySQL.
### Install
```shell
go get github.com/altipla-consulting/arrays
```
This library has no external dependencies outside the Go standard library.
### Usage
You can use the types of this package in your models structs when working with `database/sql`, `upper.io/db.v3` or `github.com/altipla-consulting/database`:
```go
type MyModel struct {
ID int64 `db:"id,omitempty"`
Foo arrays.Integers32 `db:"foo"`
Bar arrays.Integers64 `db:"bar"`
Codes arrays.Strings `db:"codes"`
}
```
### Contributing
You can make pull requests or create issues in GitHub. Any code you send should be formatted using ```gofmt```.
### Running tests
Start the test database:
```shell
docker-compose up -d database
```
Install test libs:
```shell
go get github.com/stretchr/testify
go get upper.io/db.v3
```
Run the tests:
```shell
go test
```
Shutdown the database when finished testing:
```shell
docker-compose stop database
```
### License
[MIT License](LICENSE)