{"id":18976087,"url":"https://github.com/jimsmart/schema","last_synced_at":"2025-04-15T21:23:15.055Z","repository":{"id":29882795,"uuid":"122508361","full_name":"jimsmart/schema","owner":"jimsmart","description":"schema is a Go package providing access to database schema metadata, for database/sql drivers.","archived":false,"fork":false,"pushed_at":"2023-12-04T18:54:57.000Z","size":147,"stargazers_count":54,"open_issues_count":8,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T01:24:10.176Z","etag":null,"topics":["database-schema-metadata","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimsmart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-22T17:00:51.000Z","updated_at":"2024-07-20T01:47:28.000Z","dependencies_parsed_at":"2024-06-18T16:37:05.403Z","dependency_job_id":"cf5b554e-295f-442b-9364-4bf7b7d5bd20","html_url":"https://github.com/jimsmart/schema","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimsmart%2Fschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimsmart%2Fschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimsmart%2Fschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimsmart%2Fschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimsmart","download_url":"https://codeload.github.com/jimsmart/schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249155084,"owners_count":21221534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-schema-metadata","go"],"created_at":"2024-11-08T15:22:17.625Z","updated_at":"2025-04-15T21:23:15.019Z","avatar_url":"https://github.com/jimsmart.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# schema\n\n[![BSD3](https://img.shields.io/badge/license-BSD3-blue.svg?style=flat)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/jimsmart/schema/master.svg?style=flat)](https://travis-ci.org/jimsmart/schema)\n[![codecov](https://codecov.io/gh/jimsmart/schema/branch/master/graph/badge.svg)](https://codecov.io/gh/jimsmart/schema)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jimsmart/schema)](https://goreportcard.com/report/github.com/jimsmart/schema)\n[![Used By](https://img.shields.io/sourcegraph/rrc/github.com/jimsmart/schema.svg)](https://sourcegraph.com/github.com/jimsmart/schema)\n[![Godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/jimsmart/schema)\n\nschema is a [Go](https://golang.org) package providing access to database schema metadata, for database/sql drivers.\n\nTODO more docs\n\nCurrently supporting the following database engines / SQL dialects:\n\n- Microsoft SQL Server\n- MySQL\n- Oracle\n- Postgres\n- Snowflake\n- SQLite\n- Vitess\n\nFor a list of supported drivers, and their capabilities with regards to sql.ColumnType support, see [drivercaps](https://github.com/jimsmart/drivercaps)\n\n## Installation\n\n```bash\ngo get github.com/jimsmart/schema\n```\n\n```go\nimport \"github.com/jimsmart/schema\"\n```\n\n### Dependencies\n\n- A [supported](https://github.com/jimsmart/drivercaps) database driver.\n- Standard library.\n- [Ginkgo](https://onsi.github.io/ginkgo/) and [Gomega](https://onsi.github.io/gomega/) are used in the tests.\n- Tests also require [Docker Compose](https://docs.docker.com/compose/install/) to be installed.\n\n## Example\n\nSee GoDocs for usage examples.\n\n## Documentation\n\nGoDocs [https://godoc.org/github.com/jimsmart/schema](https://godoc.org/github.com/jimsmart/schema)\n\n## Testing\n\nDatabase services for testing against are hosted in Docker.\n\nTo 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)\n\nTo run the tests execute `go test` inside the project folder.\n\nFor a full coverage report, try:\n\n```bash\ngo test -coverprofile=coverage.out \u0026\u0026 go tool cover -html=coverage.out\n```\n\nTo shutdown the Docker services, execute `docker-compose down -v` inside the project folder.\n\n### Oracle Setup Checklist\n\n#### Build Docker Image\n\nBuild a Docker image for Oracle, by executing script:\n\n```bash\n./build_oracle_docker_image.sh\n```\n\nOnce the script has successfully completed, you are free to delete the folder used when creating the image:\n\n```bash\nrm -rf ./test/docker-oracle\n```\n\n#### Increase Docker's RAM limits\n\nBy default, Docker allocates 2gb RAM to each container. To prevent out-of-memory errors when running Oracle, increase Docker's RAM limits:\n\nDocker -\u003e Preferences -\u003e Resources -\u003e Advanced -\u003e Memory, change to 4gb, click Apply \u0026 Restart.\n\n#### Install Oracle Instant Client\n\nOracle database/sql drivers require dynamic libraries that are part of the [Oracle Instant Client](https://www.oracle.com/uk/database/technologies/instant-client.html) installation.\n\n##### Mac\n\n```bash\nbrew tap InstantClientTap/instantclient\nbrew install instantclient-basic\n```\n\n## License\n\nPackage schema is copyright 2018-2021 by Jim Smart and released under the [BSD 3-Clause License](LICENSE.md).\n\n## History\n\n- v0.2.1: Added dialect alias for Vitess driver github.com/vitessio/vitess.\n- v0.2.0: Replaced Table and View methods with ColumnTypes method.\n- v0.1.0: Added schema name to methods and results.\n- v0.0.8: Disabled Oracle tests on Travis.\n- v0.0.7: Added PrimaryKey method. TableNames and ViewNames are now sorted. Improved Oracle testing. Refactored dialect handling.\n- v0.0.6: Fix Oracle quoting strategy. Added support for driver github.com/godror/godror.\n- v0.0.5: Added dialect alias for Snowflake driver github.com/snowflakedb/gosnowflake.\n- v0.0.4: Improved error handling for unknown DB driver types. Test environment now uses Docker.\n- v0.0.3: Minor code cleanups.\n- v0.0.2: Added identifier escaping for methods that query sql.ColumnType.\n- v0.0.1: Started using Go modules.\n- 2019-11-04: Fix for renamed driver struct in github.com/mattn/go-oci8 (Oracle)\n- 2019-11-04: Fix for renamed driver struct in github.com/denisenkom/go-mssqldb (MSSQL)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimsmart%2Fschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimsmart%2Fschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimsmart%2Fschema/lists"}