import db.sqlite

@[table: 'parents']
struct Parent {
	id       int     @[primary; sql: serial]
	children []Child @[fkey: 'parent_id']
}

@[table: 'children']
struct Child {
	id        int    @[primary; sql: serial]
	parent_id int
	parent    Parent
}

fn main() {
	mut db := sqlite.connect(':memory:')!
	defer {
		db.close() or { panic(err) }
	}

	sql db {
		create table Parent
	}!
}
