Display pg type?
See original GitHub issueI love that you print default value and index info in a docstring.
I noticed @slonik/typegen
prints type information too.
This would probably be noise in many cases, like text
for string
, when there is one “obvious” mapping of the TS type to the PG type. But in on other cases, it might be nice to know, and have the info at your fingertips in your IDE as you develop. Eg;
interface Foo {
/**
* Type: int
* Index: foo_bar
*/
bar: number;
}
What do you think?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Documentation: 15: 53.64. pg_type - PostgreSQL
The catalog pg_type stores information about data types. Base types and enum types (scalar types) are created with CREATE TYPE , and domains...
Read more >postgresql - Display user-defined types and their details
Bold emphasis mine. The command works for composite types as well since at least Postgres 9.1. Lists data types.
Read more >PostgreSQL Create View with Example - Guru99
In PostgreSQL, a view is a pseudo-table. This means that a view is not a real table. ... Type the following command in...
Read more >Select datatype of the field in postgres - Stack Overflow
PostgreSQL allows you to have the same table name (even an identical table) in multiple schemas. The robust way to write that WHERE...
Read more >PostgreSQL - Data Types - GeeksforGeeks
In PostgreSQL, the “bool” or”boolean” keyword is used to initialize a Boolean data type. These data types can hold true, false, and null...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, yes – fixed!
Yeah, the tag style just looks different in many syntax highlighters, including GitHub’s and VSCode’s. It helps distinguish “this is an attribute of the thing the comment describes” as opposed to “This is some human-written prose talking about the thing the comment describes”. It could also be used for certain kinds of automated tooling like a jsdoc-to-documentation-website generator, but that isn’t my intent.
I don’t feel strongly about the tag format, just wanted to suggest it since if you add every piece of information postgres knows about a table/column/etc, it might get unreadable without good delineation of some kind.
Cool, that’s awesome to hear! I’m not working with a db these days so I won’t be able to test it myself sadly, but excited for the next pg project I have so I can try it out!