SIMPLE_SQL_ROW
Represents a single row from a query result. Provides typed accessors for column values by name or position.
Typed Accessors (by column name)
string_value (a_column: READABLE_STRING_8): STRING_32
Get string value. Returns empty string if NULL.
integer_value (a_column: READABLE_STRING_8): INTEGER_64
Get integer value. Returns 0 if NULL.
real_value (a_column: READABLE_STRING_8): REAL_64
Get floating-point value. Returns 0.0 if NULL.
boolean_value (a_column: READABLE_STRING_8): BOOLEAN
Get boolean (0 = False, non-zero = True).
blob_value (a_column: READABLE_STRING_8): detachable MANAGED_POINTER
Get BLOB data as raw bytes.
Nullable Accessors
string_value_or_void (a_column: READABLE_STRING_8): detachable STRING_32
Get string or Void if NULL.
integer_value_or_void (a_column: READABLE_STRING_8): detachable INTEGER_64_REF
Get integer reference or Void if NULL.
real_value_or_void (a_column: READABLE_STRING_8): detachable REAL_64_REF
Get real reference or Void if NULL.
Nullable Columns
Use the *_or_void variants when you need to distinguish between NULL and default values (0, empty string).
Positional Access
item (a_index: INTEGER): detachable ANY
Get value at 1-based position. Returns native SQLite type.
NULL Checking
is_null (a_column: READABLE_STRING_8): BOOLEAN
True if column value is NULL.
has_column (a_column: READABLE_STRING_8): BOOLEAN
True if column exists in this row.
Examples
Typed Access
across result as row loop
print ("ID: " + row.integer_value ("id").out + "%N")
print ("Name: " + row.string_value ("name") + "%N")
print ("Active: " + row.boolean_value ("active").out + "%N")
print ("Score: " + row.real_value ("score").out + "%N")
end
Handling NULLs
across result as row loop
if row.is_null ("deleted_at") then
print ("Active record%N")
else
print ("Deleted at: " + row.string_value ("deleted_at") + "%N")
end
-- Or use nullable accessor
if attached row.string_value_or_void ("notes") as notes then
print ("Notes: " + notes + "%N")
end
end
Positional Access (for computed columns)
result := db.query ("SELECT COUNT(*), MAX(price) FROM products")
if attached result.first as row then
if attached {INTEGER_64} row.item (1) as l_count then
print ("Count: " + l_count.out + "%N")
end
if attached {REAL_64} row.item (2) as l_max then
print ("Max price: " + l_max.out + "%N")
end
end
Type Handling
SQLite has dynamic typing. When using item(), the returned type depends on SQLite's
internal storage. Use typed accessors (string_value, etc.) for predictable behavior.