Closed fashen007 closed 3 years ago
You would use the toSqlString functionality to create column objects. There are many ways to do this, but here is one:
function Column(name, alias) {
return SqlString.raw(SqlString.format('?? AS ??', [name, (alias || name)]))
}
var userId = 1;
var columns = [Column('username', '用户名'), Column('email', '邮箱')];
var sql = SqlString.format('SELECT ? FROM ?? WHERE id = ?', [columns, 'users', userId]);
for example
How to make this work correctly?