Skip to content

MySQL support #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jan 7, 2020
Merged

MySQL support #230

merged 26 commits into from
Jan 7, 2020

Conversation

kyleconroy
Copy link
Collaborator

@kyleconroy kyleconroy commented Jan 6, 2020

{
  "version": "1",
  "packages": [
    {
      "name": "bar",
      "engine": "mysql",
      "path": "internal/bar",
      "queries": "./sql/query/",
      "schema": "./sql/schema/"
    }
  ]
}

TODO:

  • Support directories when parsing schema / queries
  • Successfully generate code for the booktest package
  • Support comments that start with --
  • Pick a better field name than database

cmoog and others added 21 commits December 30, 2019 20:08
* initial commit of sql schema validation

* adds barebones support for most basic use-case

* improves parsing and generation of params

* adds decent tests for mysql

* improves param implementation
- adds tests
- adds support for named params
- adds support for Limit expressions

* adds support for decimal types

* resolves some testing issues

* generalizes imports

* adds null type tests

* improves go struct generation

* adds command line call to mysql generate

* improves support for insert queries and adds tests

* improves support for enum types

* refactors config to function param

* patchs pkg settings arguments

* simplifies and improves param parsing

* param implementation and test patches

* patch placeholder default table

* properly handles "select * " expressions

* initial commit of sql schema validation

* adds barebones support for most basic use-case

* improves parsing and generation of params

* adds decent tests for mysql

* improves param implementation
- adds tests
- adds support for named params
- adds support for Limit expressions

* adds support for decimal types

* resolves some testing issues

* generalizes imports

* adds null type tests

* improves go struct generation

* adds command line call to mysql generate

* improves support for insert queries and adds tests

* improves support for enum types

* refactors config to function param

* patchs pkg settings arguments

* simplifies and improves param parsing

* param implementation and test patches

* patch placeholder default table

* properly handles "select * " expressions
* adds support for mysql functions and select alias exprs

* adds example usage

* cleans tests

* patches generate test
Each package now has a `database` field, which can be set to either
`mysql` or `postgresql`.
@kyleconroy kyleconroy mentioned this pull request Jan 6, 2020
@kyleconroy kyleconroy marked this pull request as ready for review January 7, 2020 19:33
@kyleconroy
Copy link
Collaborator Author

@cmoog I think I'm ready to merge this in. Mind taking a look at my new commits?

@cmoog
Copy link
Contributor

cmoog commented Jan 7, 2020

@kyleconroy Nice. Your new commits look great.
One missing feature I forgot to mention is the ability for it to recognize repeat response types. At the moment it will always generate a new struct for each query response. I'm working on adding the feature now, but I suppose we could merge before the change is ready.

@kyleconroy
Copy link
Collaborator Author

One missing feature I forgot to mention is the ability for it to recognize repeat response types.

Yeah, I think that's fine to add later. MySQL support will be marked as experimental

@kyleconroy kyleconroy merged commit 92ad2e3 into master Jan 7, 2020
@kyleconroy kyleconroy deleted the mysql branch January 7, 2020 21:54
@kyleconroy
Copy link
Collaborator Author

Partial fix for #150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants