Open phiresky opened 7 years ago
$rowInstance
would be a useless (i.e. unused) field. What is the advantage of typeof tbl.$rowInstance;
over FromItemToOutRow<typeof tbl>
?
Say I have imported from
, myTable
, db
from somewhere and write a function like this:
async function getSomething() {
return await db.exec(from(myTable).select(myTable.$all));
}
async function doSomething(myTableInstance: typeof myTable.$rowInstance) {
...
}
i.e. I have imported the table definition, but not FromItemToOutRow. Now i could just specify the argument type for doSomething
using typeof myTable.$rowInstance
instead of having to add more imports or declaring that type somewhere else and importing it.
I want to be able to do
(or similar)