mysqls
mysqls copied to clipboard
field 使用 as时不能使用对象的方式设置别名
sql.table('student').field(['id', 'name', {'user_name', 'userName'}]).select()
会有以下错误: sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[object Object],sex FROM student' at line 1",
改为下列方式就可以通过: sql.table('student').field(['id', 'name', 'user_name AS userName']).select()