schema is a Go package providing access to database schema metadata, for database/sql drivers.
schema is a Go package providing access to database schema metadata, for database/sql drivers.
TODO more docs
Currently supporting the following database engines / SQL dialects:
For a list of supported drivers, and their capabilities with regards to sql.ColumnType support, see drivercaps
go get github.com/jimsmart/schema
import "github.com/jimsmart/schema"
See GoDocs for usage examples.
GoDocs https://godoc.org/github.com/jimsmart/schema
Database services for testing against are hosted in Docker.
To bring up the database services: execute docker-compose up
inside the project folder, and wait until all of the Docker services have completed their startup (i.e. there is no further output in the terminal), then open a second terminal. (In future one may choose to use docker-compose up -d
instead)
To run the tests execute go test
inside the project folder.
For a full coverage report, try:
go test -coverprofile=coverage.out && go tool cover -html=coverage.out
To shutdown the Docker services, execute docker-compose down -v
inside the project folder.
Build a Docker image for Oracle, by executing script:
./build_oracle_docker_image.sh
Once the script has successfully completed, you are free to delete the folder used when creating the image:
rm -rf ./test/docker-oracle
By default, Docker allocates 2gb RAM to each container. To prevent out-of-memory errors when running Oracle, increase Docker’s RAM limits:
Docker -> Preferences -> Resources -> Advanced -> Memory, change to 4gb, click Apply & Restart.
Oracle database/sql drivers require dynamic libraries that are part of the Oracle Instant Client installation.
brew tap InstantClientTap/instantclient
brew install instantclient-basic
Package schema is copyright 2018-2021 by Jim Smart and released under the BSD 3-Clause License.