question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I 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:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rattrayalexcommented, Apr 19, 2021

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.

0reactions
rattrayalexcommented, Aug 23, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found