GithubHelp home page GithubHelp logo

jimsmart / schema Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 21.0 147 KB

schema is a Go package providing access to database schema metadata, for database/sql drivers.

License: BSD 3-Clause "New" or "Revised" License

Go 96.07% Shell 3.35% TSQL 0.58%
database-schema-metadata go

schema's People

Contributors

ghstahl avatar jarrodhroberson avatar jimsmart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

schema's Issues

columnTypes query does not escape tablename

I am testing using the following sqlserver image.

 sqlserver:
    image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
    container_name: sqlserver
    volumes:
      - sqlserverdata:/var/opt/mssql 
    ports:
      - "1434:1433"
    environment:
      - ACCEPT_EULA=Y 
      - MSSQL_PID=Developer
      - SA_PASSWORD=8jkGh47hnDw89Haq8LN2

The queries for getting colum types in the various dialect_{{type}}.go are

mssql 
`SELECT * FROM %s WHERE 1=0`,

vs

mysql
`SELECT * FROM %s LIMIT 0`,

Some real examples,

mssql 
SELECT * FROM Vehicle WHERE 1=0
mssql 
SELECT * FROM `Vehicle` WHERE 1=0
 "Incorrect syntax near '`'."
mysql
SELECT * FROM `Vehicle`  LIMIT 0

I would think that the dialect_mysql.go should account for the back-ticks. I haven't tested this on a mysql image, so I don't know for sure.

`SELECT * FROM `%s` LIMIT 0`,

Upstream customers of the schema library, for all database types, are passing in

"`"+tablename+"`"

where they should have just been passing in

tablename

Whose responsibility is it to know the different variations of a tablename?
upstream customers or the schema library?

If its the schema library then we have a breaking change because upstream libraries are passing in

"`"+tablename+"`"

Test environment does not include Snowflake

Re #14

Support for Snowflake database is difficult to test because it is a commercial service with no open/free offering (beyond a free trial).

Should they ever offer a free test account for open source software that chooses to support their product, then we should implement tests for this db/driver in Travis CI.

Travis CI fails for Postgres

Travis is setup to build nightly, and has been successfully building for some time.

Without changes, builds are now failing. For example https://travis-ci.org/jimsmart/schema/builds/650973349 โ€” this is bad because the badge on the main page says builds are failing, when technically it's just a CI config issue (the code builds and runs just fine)/

Builds are failing on Travis currently because the build attempts to launch all of the Docker db images for a single build, and the tests run before the dbs are up.

I have started work to split each db (and driver) into a separate build on a separate branch, because this was anticipated, but that work isn't quite finished.

Enable Oracle testing on Travis CI / similar

The local Docker setup now includes Oracle support, including a script to create a Docker Oracle image.

But this is not currently used on Travis.

We need a solution to be able to test against an Oracle database on Travis / similar. I'm not attached to Travis if we can find another CI provider with Oracle support.

Perhaps this will work https://github.com/cbandy/travis-oracle โ€” I've not tried.

Migrated from previous #12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.