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