Output information on PRIMARY KEY and UNIQUE constraints#81
Output information on PRIMARY KEY and UNIQUE constraints#81frankpf wants to merge 14 commits intoSweetIQ:masterfrom
Conversation
f79f289 to
05ecdcc
Compare
|
Would it be better to change the name of "verbose" parameter into something more descriptive for example "extendedTableMeta" ? |
|
Looks like the RuleProvider error is being fixed by #82 |
|
I updated the flag to be |
|
The tests/examples/README still need to be updated, I'll try to do that this week. |
6e4ea8e to
7562e0a
Compare
|
Good work ! |
|
I tested adding the original SQL type to the output ( The reason I didn't include it in this PR is that some types (at least in Postgres) are mapped internally to something else. For example, a column with a I don't know if that's a big problem though. Maybe we should add it with those internal Postgres types now and then try fix the library to use more "specific" types later? |
IIRC, for most of the types, udt name is pretty clear. Anyway, I think it's better for this PR to focus on constraints only. |
Seems reasonable. |
a642842 to
cf513f8
Compare
cf513f8 to
29db057
Compare
|
All tests are passing 😃 |
|
Is this totally dead? I was really hoping schemats supported exporting unique/pk constraints to aid in type safe upserts! |
|
Both of the original maintainers @crispmark and I left sweetiq and to the best of my knowledge there's no one maintaining this project at the moment. |
|
@DiskImage Last time I ran it, this PR was working fine. It's not in master but if you really want this you can clone the branch and use it. I can help you if you have any issues with it. I'm working on a new project using http://www.pg-structure.com/ to do the same thing here. The difference to schemats is that pg-structure creates a data structure to introspect the database, so you can use it to create all kinds of outputs, whereas schemats is "hardcoded" to output TypeScript interfaces. |
This PR implements part of #77. It modifies schemats so it outputs interfaces like this:
It also adds the
--verboseflag to control the output. When verbose mode is on, the meta-interfaces are simply renamed:If it's off, the meta-interfaces are simplified using the helper types in #77 (comment):
One thing to note is that the non-formatted output includes some trailing commas. I couldn't test the formatted output because I was getting the following error from 'typescript-formatter: