Prepared Sqlite3 statement

Instances of this class are created from Sqlite3DB::prepare and its shortcuts: create_table, insert, replace and select. The results should be explored with an iterator, and each call to iterator resets the request. If close_with_iterator the iterator calls close on this request upon finishing.

Introduced properties

fun close

sqlite3 :: Statement :: close

Close and finalize this statement
fun close_with_iterator: Bool

sqlite3 :: Statement :: close_with_iterator

Should any iterator close this statement on Iterator::finish?
fun close_with_iterator=(close_with_iterator: Bool)

sqlite3 :: Statement :: close_with_iterator=

Should any iterator close this statement on Iterator::finish?
init defaultinit(native_statement: NativeStatement)

sqlite3 :: Statement :: defaultinit

fun is_open: Bool

sqlite3 :: Statement :: is_open

Is this statement usable?
protected fun is_open=(is_open: Bool)

sqlite3 :: Statement :: is_open=

Is this statement usable?
fun iterator: StatementIterator

sqlite3 :: Statement :: iterator

Reset this statement and return a StatementIterator to iterate over the result

Redefined properties

redef type SELF: Statement

sqlite3 $ Statement :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun close

sqlite3 :: Statement :: close

Close and finalize this statement
fun close_with_iterator: Bool

sqlite3 :: Statement :: close_with_iterator

Should any iterator close this statement on Iterator::finish?
fun close_with_iterator=(close_with_iterator: Bool)

sqlite3 :: Statement :: close_with_iterator=

Should any iterator close this statement on Iterator::finish?
init defaultinit(native_statement: NativeStatement)

sqlite3 :: Statement :: defaultinit

fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_open: Bool

sqlite3 :: Statement :: is_open

Is this statement usable?
protected fun is_open=(is_open: Bool)

sqlite3 :: Statement :: is_open=

Is this statement usable?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun iterator: StatementIterator

sqlite3 :: Statement :: iterator

Reset this statement and return a StatementIterator to iterate over the result
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram sqlite3::Statement Statement core::Object Object sqlite3::Statement->core::Object

Parents

interface Object

core :: Object

The root of the class hierarchy.

Class definitions

sqlite3 $ Statement
# Prepared Sqlite3 statement
#
# Instances of this class are created from `Sqlite3DB::prepare` and
# its shortcuts: `create_table`, `insert`, `replace` and `select`.
# The results should be explored with an `iterator`,
# and each call to `iterator` resets the request.
# If `close_with_iterator` the iterator calls `close`
# on this request upon finishing.
class Statement
	private var native_statement: NativeStatement

	# Is this statement usable?
	var is_open = true

	# Should any `iterator` close this statement on `Iterator::finish`?
	#
	# If `true`, the default, any `StatementIterator` created by calls to
	# `iterator` invokes `close` on this request when finished iterating.
	# Otherwise, `close` must be called manually.
	var close_with_iterator = true is writable

	# Close and finalize this statement
	fun close
	do
		if not is_open then return

		is_open = false
		native_statement.finalize
	end

	# Reset this statement and return a `StatementIterator` to iterate over the result
	fun iterator: StatementIterator
	do
		native_statement.reset
		return new StatementIterator(self)
	end
end
lib/sqlite3/sqlite3.nit:115,1--151,3