You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api-reference.md
+57-1Lines changed: 57 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,67 @@ Complete API documentation for @photostructure/sqlite. This package provides 100
4
4
5
5
## Table of Contents
6
6
7
+
-[Module Exports](#module-exports)
7
8
-[DatabaseSync](#databasesync)
8
9
-[StatementSync](#statementsync)
9
10
-[Types and Interfaces](#types-and-interfaces)
10
11
-[Constants](#constants)
11
12
-[Error Handling](#error-handling)
12
13
14
+
## Module Exports
15
+
16
+
The module exports the following items that match `node:sqlite`:
17
+
18
+
```typescript
19
+
import {
20
+
DatabaseSync, // Main database class
21
+
StatementSync, // Prepared statement class
22
+
Session, // Session class for changesets
23
+
backup, // Standalone backup function
24
+
constants, // SQLite constants
25
+
} from"@photostructure/sqlite";
26
+
```
27
+
28
+
### backup()
29
+
30
+
```typescript
31
+
backup(
32
+
sourceDb: DatabaseSync,
33
+
destination: string|Buffer|URL,
34
+
options?:BackupOptions
35
+
): Promise<number>
36
+
```
37
+
38
+
Standalone function to create a backup of a database. This function is equivalent to calling `db.backup()` on a database instance, but allows passing the source database as a parameter.
39
+
40
+
**Parameters:**
41
+
42
+
-`sourceDb` - The database instance to back up
43
+
-`destination` - Path to the backup file (string, Buffer, or file: URL)
44
+
-`options` - Optional backup configuration
45
+
46
+
**Returns:** A Promise that resolves to the total number of pages backed up.
0 commit comments