Closed Bzik closed 8 years ago
Hello!
There are a few drivers provided by the library. Most of them inherit from the common SqlDriver
class. If you get the driver directly (not through the Gateway
), you can access the execute
method on the SqlDriver
. That will let you execute any SQL query, returning a Stream<Map<String, dynamic>>
.
Example:
final driver = new PostgreSqlDriver( ... );
final gateway = new Gateway(driver);
main() {
gateway
.table('users')
.where((user) => user.age > 18)
.get()
.listen(print);
driver.execute('SELECT * FROM "users" WHERE "age" > 18')
.listen(print);
}
It would be great if we could use SQL commands. In the case of complex commands or lack of support from the library.