THT is in early Beta. We welcome contributors & feedback.

Db.selectRows

Db.selectRows(lockSql)

Description

Return the result of a SQL 'select' statement as a List of Maps.

Each Map represents one row of the result.

let query = L'SELECT id, name FROM users ORDER BY name';
let users = Db.selectRows(query);

// Example result:
// [
//     { id: 1, name: 'Ann' },
//     { id: 3, name: 'Bob' },
//     { id: 2, name: 'Cody' },
// ]

for (user in users) {
    print(user.name);
}