@@ -24,14 +24,32 @@ public function __construct(string $conn_id, string $sql) {}
24
24
*/
25
25
public function finalize () {}
26
26
27
+ /**
28
+ * Binds a value to a named parameter in the prepared statement.
29
+ *
30
+ * @param array<string, mixed> $parameters The parameters to bind.
31
+ *
32
+ * @return void
33
+ */
34
+ public function bindNamed (array $ parameters ) {}
35
+
36
+ /**
37
+ * Binds a value to a positionalparameter in the prepared statement.
38
+ *
39
+ * @param array<mixed> $parameters The value to bind.
40
+ *
41
+ * @return void
42
+ */
43
+ public function bindPositional (array $ parameters ) {}
44
+
27
45
/**
28
46
* Executes the prepared statement with given parameters.
29
47
*
30
48
* @param array $parameters The parameters for the statement.
31
49
*
32
50
* @return int The number of affected rows.
33
51
*/
34
- public function execute (array $ parameters ) {}
52
+ public function execute (array $ parameters = [] ) {}
35
53
36
54
/**
37
55
* Executes the prepared statement and retrieves the result set.
@@ -377,6 +395,52 @@ public function changes() {}
377
395
*/
378
396
public function isAutocommit () {}
379
397
398
+ /**
399
+ * Retrieves the number of rows changed by the last SQL statement.
400
+ *
401
+ * ## Example Usage
402
+ *
403
+ * ```
404
+ * // Create a new LibSQL instance
405
+ * $db = new LibSQL("libsql:dbname=database.db");
406
+ *
407
+ * $stmt = "UPDATE users SET age = 28 WHERE id = 1";
408
+ * $db->execute($stmt);
409
+ *
410
+ * // Retrieve the number of rows changed
411
+ * $changes = $db->totalChanges();
412
+ * echo "Number of Rows Changed: " . $changes;
413
+ *
414
+ * $db->close();
415
+ * ```
416
+ *
417
+ * @return int The total number of rows changed.
418
+ */
419
+ public function totalChanges () {}
420
+
421
+ /**
422
+ * Retrieves the ID of the last inserted row.
423
+ *
424
+ * ## Example Usage
425
+ *
426
+ * ```
427
+ * // Create a new LibSQL instance
428
+ * $db = new LibSQL("libsql:dbname=database.db");
429
+ *
430
+ * $stmt = "INSERT INTO users (name, age) VALUES ('John Doe', 30)";
431
+ * $db->execute($stmt);
432
+ *
433
+ * // Retrieve the ID of the last inserted row
434
+ * $id = $db->lastInsertedId();
435
+ * echo "Last inserted row ID: " . $id;
436
+ *
437
+ * $db->close();
438
+ * ```
439
+ *
440
+ * @return int The ID of the last inserted row.
441
+ */
442
+ public function lastInsertedId () {}
443
+
380
444
/**
381
445
* Executes an SQL statement on the database.
382
446
*
0 commit comments