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:
1 // The implementation of the collation 2 int my_collation(string s1, string s2) nothrow 3 { 4 import std.uni : icmp; 5 import std.exception : assumeWontThrow; 6 7 return assumeWontThrow(icmp(s1, s2)); 8 } 9 10 auto db = Database(":memory:"); 11 db.createCollation("my_coll", &my_collation); 12 db.run("CREATE TABLE test (word TEXT); 13 INSERT INTO test (word) VALUES ('straße'); 14 INSERT INTO test (word) VALUES ('strasses');"); 15 16 auto word = db.execute("SELECT word FROM test ORDER BY word COLLATE my_coll") 17 .oneValue!string; 18 assert(word == "straße");
Creates and registers a collation function in the database.