这有效:
val select = "select code,descrip from table1"
val action = sql"#$select".as[(Int,String)]
val future = db1.run(action.asTry)
但是我需要在运行时动态构建select中的列数,因此as
也必须是动态的:
val action = sql"#$select".as[(Int,String, .... defined at runtime ....)]
这可能吗?