Skip to content
This repository has been archived by the owner on Dec 29, 2018. It is now read-only.

altipla-consulting/arrays

Repository files navigation

arrays

DEPRECATED: Use https://github.com/altipla-consulting/libs instead.

GoDoc

Models for integer and string arrays in MySQL.

Install

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:

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:

docker-compose up -d database

Install test libs:

go get github.com/stretchr/testify
go get upper.io/db.v3

Run the tests:

go test

Shutdown the database when finished testing:

docker-compose stop database

License

MIT License