public void test_column_origin() { using (sqlite3 db = ugly.open(":memory:")) { db.exec("CREATE TABLE foo (x int, v int, t text, d real, b blob, q blob);"); byte[] blob = db.query_scalar <byte[]>("SELECT randomblob(5);"); db.exec("INSERT INTO foo (x,v,t,d,b,q) VALUES (?,?,?,?,?,?)", 32, 44, "hello", 3.14, blob, null); #if not // maybe we should just let this fail so we can // see the differences between running against the built-in // sqlite vs a recent version? if (1 == raw.sqlite3_compileoption_used("ENABLE_COLUMN_METADATA")) #endif { using (sqlite3_stmt stmt = db.prepare("SELECT x AS mario FROM foo;")) { stmt.step(); Assert.IsTrue(stmt.stmt_readonly() != 0); Assert.AreEqual(stmt.column_database_name(0), "main"); Assert.AreEqual(stmt.column_table_name(0), "foo"); Assert.AreEqual(stmt.column_origin_name(0), "x"); Assert.AreEqual(stmt.column_name(0), "mario"); Assert.AreEqual(stmt.column_decltype(0), "int"); } } } }