import db.sqlite

struct Foo {
	id   u64     [primary; sql: serial]
	name ?string
}

fn bar(val ?string) ! {
	db := sqlite.connect(':memory:')!
	_ := sql db {
		select from Foo where name == val
	}!
}

fn main() {
	db := sqlite.connect(':memory:')!

	sql db {
		create table Foo
	}!

	bar(none) or {}

	_ := sql db {
		select from Foo where name == none
	}!

	_ := sql db {
		select from Foo where name != none
	}!

	_ := sql db {
		select from Foo where name < none
	}!

	_ := sql db {
		select from Foo where name > none
	}!

	_ := sql db {
		select from Foo where name <= none
	}!

	_ := sql db {
		select from Foo where name >= none
	}!

	_ := sql db {
		select from Foo where name is none
	}!

	_ := sql db {
		select from Foo where name !is none
	}!
}
