literal

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

string
literal
(
T
)
()

Examples

assert(null.literal == "NULL");
assert(false.literal == "0");
assert(true.literal == "1");
assert(4.literal == "4");
assert(4.1.literal == "4.1");
assert("foo".literal == "'foo'");
assert("a'b'".literal == "'a''b'''");
import std.conv : hexString;
auto a = cast(Blob) hexString!"DEADBEEF";
assert(a.literal == "'XDEADBEEF'");

Meta