literal

Turns value into a literal that can be used in an SQLite expression.

string
literal
(
T
)
()

Examples

1 assert(null.literal == "NULL");
2 assert(false.literal == "0");
3 assert(true.literal == "1");
4 assert(4.literal == "4");
5 assert(4.1.literal == "4.1");
6 assert("foo".literal == "'foo'");
7 assert("a'b'".literal == "'a''b'''");
8 auto a = cast(Blob) x"DEADBEEF";
9 assert(a.literal == "'XDEADBEEF'");

Meta