Implement sqlite REGEXP
This commit is contained in:
@ -3,6 +3,7 @@ using Microsoft.Data.Sqlite;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
@ -26,6 +27,7 @@ namespace Elwig.Windows {
|
||||
IList<DbColumn> header;
|
||||
|
||||
using (var cnx = new SqliteConnection(AppDbContext.ConnectionString)) {
|
||||
cnx.CreateFunction<string, string?, bool?>("REGEXP", (pattern, value) => value == null ? null : Regex.Match(value, pattern).Success, true);
|
||||
cnx.Open();
|
||||
var cmd = cnx.CreateCommand();
|
||||
cmd.CommandText = sqlQuery;
|
||||
|
Reference in New Issue
Block a user