Skip to content
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

Specify the schema to use for a table #102

GohuHQ opened this issue Jun 21, 2019 · 1 comment

Specify the schema to use for a table #102

GohuHQ opened this issue Jun 21, 2019 · 1 comment


Copy link

@GohuHQ GohuHQ commented Jun 21, 2019

It can be useful in a class model and it's maybe something we want to specify at a name space level depending on the use case..

Here is the solution we used for the moment to target the db schema :

class SqlBase:
    __schema__ = None

    def define_table_kwargs(cls):
        res = super(SqlBase, cls).define_table_kwargs()
        if cls.__schema__ is not None:
            res.update({'schema': cls.__schema__})
        return res

@Declarations.register(Declarations.Model, tablename='Order')
class Order:
  __schema__ = 'MySchema'

This comment has been minimized.

Copy link
Contributor Author

@GohuHQ GohuHQ commented Jun 24, 2019

We have also detected that creating new columns in the table is not possible yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.