-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass argument in custom SQL Query? #973
Comments
You can pass variables like this: Stream<List<Password>> watchSearchedPasswords(String query) {
return customSelectStream('SELECT * FROM Password ORDER BY wName ASC WHERE wName CONTAINS ?1 OR wAddress CONTAINS ?1;',
variables: [Variable.withString(query)],
readsFrom: {passwords},
).map((rows) {
return rows.map((row) => Password.fromData(row.data, db)).toList();
});
} But in that case I recommend to use build-time checked queries or moor files which can generate those methods for you. Also, feel free to ask questions like that in the discussions. |
I am getting following exception: |
Ah yeah, the |
But Still I am getting Exception :-(
|
Ah yeah, |
I have solved my issue, in Query I am typing instr that's why I'm getting exception, I solved it by writing it in upper case like INSTR, but it is case sensitive so there is any way to find the substring of data with case insensitive . |
You could use |
I have created following method in which i want to return list of rows that contains string which i provide when method is called but how to pass it?
The text was updated successfully, but these errors were encountered: