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

Way to associate additional metadata with schema? #434

Open
cakoose opened this issue Feb 7, 2022 · 0 comments
Open

Way to associate additional metadata with schema? #434

cakoose opened this issue Feb 7, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@cakoose
Copy link
Collaborator

cakoose commented Feb 7, 2022

There are a few cases where we want to add annotations to our DB schema for another tool to read. For example, we want to select a subset of columns to export to our BI/analytics database:

We could define something like this:

const usersTableBiExports = {
    id: true,
    createdTime: true,
    name: true,
    ...
};

I was wondering if there's a way to specify this as part of the Mammoth schema itself, just so it's all in one place, e.g.:

const users = defineTable({
    id: text().notNull().primaryKey().metadata({bi: true}),
    createdTime: timestamptz().notNull().metadata({bi: true}),
    name: text().notNull().metadata({bi: true}),
    emailAddress: citext().notNull().unique().metadata({bi: true}),
    passwordHash: bytea().notNull().metadata({bi: false}),
});

Thoughts?

@cakoose cakoose added the enhancement New feature or request label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant