Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions types/frida-gum/frida-gum-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,17 @@ const moduleObserver = Process.attachModuleObserver({
});
moduleObserver.detach();

const db = SqliteDatabase.openInline("AAAA");
const stmt = db.prepare("SELECT * from tab;");
// $ExpectType string[]
stmt.columnNames;
// $ExpectType SqliteColumnType[]
stmt.columnTypes;
// $ExpectType (string | null)[]
stmt.declaredTypes;
// $ExpectType number
stmt.paramsCount;

// $ExpectType Profiler
const profiler = new Profiler();
const sampler = new BusyCycleSampler();
Expand Down
24 changes: 24 additions & 0 deletions types/frida-gum/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,28 @@ type SqliteOpenFlag =
* Pre-compiled SQL statement.
*/
declare class SqliteStatement {
/**
* Names of the columns in the prepared statement.
*/
readonly columnNames: string[];

/**
* Types of the columns in the prepared statement.
*/
readonly columnTypes: SqliteColumnType[];

/**
* Declared types of the columns as specified in the table schema. Each
* element is the type string (e.g. `"TEXT"`, `"INTEGER"`) or `null` if
* the column has no declared type (e.g. expression columns).
*/
readonly declaredTypes: Array<string | null>;

/**
* Number of SQL parameters in the prepared statement.
*/
readonly paramsCount: number;

/**
* Binds the integer `value` to `index`.
*
Expand Down Expand Up @@ -3172,6 +3194,8 @@ declare class SqliteStatement {
reset(): void;
}

type SqliteColumnType = "integer" | "float" | "text" | "blob" | "null";

/**
* Intercepts execution through inline hooking.
*/
Expand Down