Skip to content
This repository was archived by the owner on Nov 1, 2018. It is now read-only.

Custom functions support #402

Closed
evil-shrike opened this issue Aug 23, 2017 · 3 comments
Closed

Custom functions support #402

evil-shrike opened this issue Aug 23, 2017 · 3 comments

Comments

@evil-shrike
Copy link

Hi.
SQLite supports custom functions. And most broadly used sqlite provider on .net - System.Data.SQLite supports them as well.

It'd be nice to have the same in Microsoft.Data.Sqlite.

Here's an example how it looks in System.Data.SQlite - :

	[SQLiteFunction(FuncType = FunctionType.Collation, Name = "NOCASE")]
	public class OrdinalIgnoreCaseCollation : SQLiteFunction
	{
		public override int Compare(string param1, string param2)
		{
			return StringComparer.OrdinalIgnoreCase.Compare(param1, param2);
		}
	}

then it should be registered as SQLiteFunction.RegisterFunction(typeof(OrdinalIgnoreCaseCollation));

@AlexanderTaeschner
Copy link
Contributor

You can already use SqliteConnection.CreateCollation to add custom collations (see #19 for the API). The addition of other functions is in the works (tracked by #14).

@evil-shrike
Copy link
Author

evil-shrike commented Aug 23, 2017

@AlexanderTaeschner cool, thanks! can be closed.

@bricelam
Copy link
Contributor

Duplicate of #19, duplicate of #14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants