arrays

package module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2018 License: MIT Imports: 3 Imported by: 0

README

arrays

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

Documentation

Overview

Package arrays has models for integer and string arrays in MySQL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SearchIntegers32 added in v1.1.0

func SearchIntegers32(column string) string

func SearchIntegers64 added in v1.1.0

func SearchIntegers64(column string) string

func SearchStrings added in v1.1.0

func SearchStrings(column string) string

Types

type Integers32

type Integers32 []int32

func (*Integers32) Scan

func (slice *Integers32) Scan(value interface{}) error

func (Integers32) Value

func (slice Integers32) Value() (driver.Value, error)

type Integers64

type Integers64 []int64

func (*Integers64) Scan

func (slice *Integers64) Scan(value interface{}) error

func (Integers64) Value

func (slice Integers64) Value() (driver.Value, error)

type Strings

type Strings []string

func (*Strings) Scan

func (slice *Strings) Scan(value interface{}) error

func (Strings) Value

func (slice Strings) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL