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.

A concise type for a table?

See original GitHub issue

Let’s say I have a DB with a users table and the appropriate Mammoth defineTable and defineDb calls.

How can I get a concise type for that table, e.g. for use in a function signature:

function processUser(user: ???) { ... }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
martijndehcommented, Dec 4, 2020

A change to this just hit master. There may be some edge cases left to support but a straightforward db.select(star()).from(..) with different joins should just work.

0reactions
cakoosecommented, Nov 26, 2020

Since star is a common word, I think some people (like me) would use a qualified import, e.g.

import * as mammoth from '...'
...
db.select(mammoth.star(db.user)).from(...)

That’s not so bad.

Also, there’s the full SELECT * FROM ... and the table-specific SELECT t1.*, t2.f1 FROM .... Not sure if it’s worth addressing both of those.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Designing Tables - Graphing - LabWrite
It should be concise and include the key elements shown in the table, for example, groups, classifications, variables, etc. It should never be...
Read more >
Concise table names vs readability - Stack Overflow
So we are coming up with a lot of ProjectUserXXX table names. Some devs wan't to just get rid of the ProjectUser prefix,...
Read more >
Figures and Charts - UNC Writing Center
Elements of a table include the Legend or Title, Column Titles, and the Table Body (quantitative or qualitative data). They may also include...
Read more >
APA Tables and Figures - Purdue OWL
Like the title of the paper itself, each table must have a clear and concise title. Titles should be written in italicized title...
Read more >
APA Format for Tables and Figures | Annotated Examples
A table concisely presents information (often numbers) in rows and columns. A figure is any other image or illustration you include in your...
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