The name that the function will have in the database.
a delegate or function that implements the collation. The function fun must be nothrow` and satisfy these criteria:
// The implementation of the collation int my_collation(string s1, string s2) nothrow { import std.uni : icmp; import std.exception : assumeWontThrow; return assumeWontThrow(icmp(s1, s2)); } auto db = Database(":memory:"); db.createCollation("my_coll", &my_collation); db.run("CREATE TABLE test (word TEXT); INSERT INTO test (word) VALUES ('straße'); INSERT INTO test (word) VALUES ('strasses');"); auto word = db.execute("SELECT word FROM test ORDER BY word COLLATE my_coll") .oneValue!string; assert(word == "straße");
Creates and registers a collation function in the database.