← Files RivetARCHIVED FILE
node_modules/drizzle-orm/sql/expressions/select.cjs
1.16 KB · Nov 5, 2026 · 12:09 UTC
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_sql_sql = require('../sql.cjs');
//#region src/sql/expressions/select.ts
/**
* Used in sorting, this specifies that the given
* column or expression should be sorted in ascending
* order. By the SQL standard, ascending order is the
* default, so it is not usually necessary to specify
* ascending sort order.
*
* ## Examples
*
* ```ts
* // Return cars, starting with the oldest models
* // and going in ascending order to the newest.
* db.select().from(cars)
* .orderBy(asc(cars.year));
* ```
*
* @see desc to sort in descending order
*/
function asc(column) {
return require_sql_sql.sql`${column} asc`;
}
/**
* Used in sorting, this specifies that the given
* column or expression should be sorted in descending
* order.
*
* ## Examples
*
* ```ts
* // Select users, with the most recently created
* // records coming first.
* db.select().from(users)
* .orderBy(desc(users.createdAt));
* ```
*
* @see asc to sort in ascending order
*/
function desc(column) {
return require_sql_sql.sql`${column} desc`;
}
//#endregion
exports.asc = asc;
exports.desc = desc;
//# sourceMappingURL=select.cjs.mapSHA-256: a4d722b70233d1f00dfad65d03f8292b7b6c3152a535bbc04e422d4b2a3e9b3a