Is using "_" (underscore) safe?

I'm using underscore to get selected fields from subquery. I'm thinking it should be for internals maybe removed future releases? Example:
const sq = this.db.$with('prods_with_qty').as(
this.db
.select({
...getTableColumns(ProductsTable),
qty: SQL_PRODUCT_STOCKS_QTY,
})
.from(ProductsTable),
);
this.db
.with(sq)
.select({
...sq._.selectedFields, // <- here. It's working perfectly fine, but should I do that?
owner: SQL_USER_MINI_RES_COLS,
})
.from(sq)
const sq = this.db.$with('prods_with_qty').as(
this.db
.select({
...getTableColumns(ProductsTable),
qty: SQL_PRODUCT_STOCKS_QTY,
})
.from(ProductsTable),
);
this.db
.with(sq)
.select({
...sq._.selectedFields, // <- here. It's working perfectly fine, but should I do that?
owner: SQL_USER_MINI_RES_COLS,
})
.from(sq)
1 Reply
Ghost
GhostOP2w ago
Another usage: table: T | WithSubqueryWithSelection<T['_']['columns'], string>;

Did you find this page helpful?