@capacitor-community/sqlite 4.1.0-6 → 4.1.0-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -347,6 +347,10 @@ export interface capConnectionOptions {
347
347
  * ["encryption", "secret", "newsecret"]
348
348
  */
349
349
  mode?: string;
350
+ /**
351
+ * Set to true (database in read-only mode) / false
352
+ */
353
+ readonly?: boolean;
350
354
  }
351
355
  export interface capAllConnectionsOptions {
352
356
  /**
@@ -360,6 +364,10 @@ export interface capSQLiteOptions {
360
364
  * The database name
361
365
  */
362
366
  database?: string;
367
+ /**
368
+ * Set to true (database in read-only mode) / false
369
+ */
370
+ readonly?: boolean;
363
371
  }
364
372
  export interface capNCDatabasePathOptions {
365
373
  /**
@@ -402,6 +410,12 @@ export interface capSQLiteExecuteOptions {
402
410
  * @since 3.0.0-beta.10
403
411
  */
404
412
  transaction?: boolean;
413
+ /**
414
+ * ReadOnly / ReadWrite
415
+ * default ReadWrite (false)
416
+ * @since 4.1.0-7
417
+ */
418
+ readonly?: boolean;
405
419
  }
406
420
  export interface capSQLiteSetOptions {
407
421
  /**
@@ -418,6 +432,12 @@ export interface capSQLiteSetOptions {
418
432
  * @since 3.0.0-beta.10
419
433
  */
420
434
  transaction?: boolean;
435
+ /**
436
+ * ReadOnly / ReadWrite
437
+ * default ReadWrite (false)
438
+ * @since 4.1.0-7
439
+ */
440
+ readonly?: boolean;
421
441
  }
422
442
  export interface capSQLiteRunOptions {
423
443
  /**
@@ -438,6 +458,12 @@ export interface capSQLiteRunOptions {
438
458
  * @since 3.0.0-beta.10
439
459
  */
440
460
  transaction?: boolean;
461
+ /**
462
+ * ReadOnly / ReadWrite
463
+ * default ReadWrite (false)
464
+ * @since 4.1.0-7
465
+ */
466
+ readonly?: boolean;
441
467
  }
442
468
  export interface capSQLiteQueryOptions {
443
469
  /**
@@ -454,6 +480,12 @@ export interface capSQLiteQueryOptions {
454
480
  * @since 3.0.0-beta.11
455
481
  */
456
482
  values?: any[];
483
+ /**
484
+ * ReadOnly / ReadWrite
485
+ * default ReadWrite (false)
486
+ * @since 4.1.0-7
487
+ */
488
+ readonly?: boolean;
457
489
  }
458
490
  export interface capSQLiteImportOptions {
459
491
  /**
@@ -473,6 +505,12 @@ export interface capSQLiteExportOptions {
473
505
  *
474
506
  */
475
507
  jsonexportmode?: string;
508
+ /**
509
+ * ReadOnly / ReadWrite
510
+ * default ReadWrite (false)
511
+ * @since 4.1.0-7
512
+ */
513
+ readonly?: boolean;
476
514
  }
477
515
  export interface capSQLiteFromAssetsOptions {
478
516
  /**
@@ -492,6 +530,12 @@ export interface capSQLiteSyncDateOptions {
492
530
  * Format yyyy-MM-dd'T'HH:mm:ss.SSSZ
493
531
  */
494
532
  syncdate?: string;
533
+ /**
534
+ * ReadOnly / ReadWrite
535
+ * default ReadWrite (false)
536
+ * @since 4.1.0-7
537
+ */
538
+ readonly?: boolean;
495
539
  }
496
540
  export interface capSQLiteSet {
497
541
  /**
@@ -536,6 +580,12 @@ export interface capSQLiteTableOptions {
536
580
  * The table name
537
581
  */
538
582
  table?: string;
583
+ /**
584
+ * ReadOnly / ReadWrite
585
+ * default ReadWrite (false)
586
+ * @since 4.1.0-7
587
+ */
588
+ readonly?: boolean;
539
589
  }
540
590
  export interface capEchoResult {
541
591
  /**
@@ -810,24 +860,27 @@ export interface ISQLiteConnection {
810
860
  * @param encrypted
811
861
  * @param mode
812
862
  * @param version
863
+ * @param readonly
813
864
  * @returns Promise<SQLiteDBConnection>
814
865
  * @since 2.9.0 refactor
815
866
  */
816
- createConnection(database: string, encrypted: boolean, mode: string, version: number): Promise<SQLiteDBConnection>;
867
+ createConnection(database: string, encrypted: boolean, mode: string, version: number, readonly: boolean): Promise<SQLiteDBConnection>;
817
868
  /**
818
869
  * Check if a connection exists
819
870
  * @param database
871
+ * @param readonly
820
872
  * @returns Promise<capSQLiteResult>
821
873
  * @since 3.0.0-beta.5
822
874
  */
823
- isConnection(database: string): Promise<capSQLiteResult>;
875
+ isConnection(database: string, readonly: boolean): Promise<capSQLiteResult>;
824
876
  /**
825
877
  * Retrieve an existing database connection
826
878
  * @param database
879
+ * @param readonly
827
880
  * @returns Promise<SQLiteDBConnection>
828
881
  * @since 2.9.0 refactor
829
882
  */
830
- retrieveConnection(database: string): Promise<SQLiteDBConnection>;
883
+ retrieveConnection(database: string, readonly: boolean): Promise<SQLiteDBConnection>;
831
884
  /**
832
885
  * Retrieve all database connections
833
886
  * @returns Promise<Map<string, SQLiteDBConnection>>
@@ -837,10 +890,11 @@ export interface ISQLiteConnection {
837
890
  /**
838
891
  * Close a database connection
839
892
  * @param database
893
+ * @param readonly
840
894
  * @returns Promise<void>
841
895
  * @since 2.9.0 refactor
842
896
  */
843
- closeConnection(database: string): Promise<void>;
897
+ closeConnection(database: string, readonly: boolean): Promise<void>;
844
898
  /**
845
899
  * Close all database connections
846
900
  * @returns Promise<void>
@@ -979,10 +1033,10 @@ export declare class SQLiteConnection implements ISQLiteConnection {
979
1033
  changeEncryptionSecret(passphrase: string, oldpassphrase: string): Promise<void>;
980
1034
  clearEncryptionSecret(): Promise<void>;
981
1035
  addUpgradeStatement(database: string, toVersion: number, statements: string[]): Promise<void>;
982
- createConnection(database: string, encrypted: boolean, mode: string, version: number): Promise<SQLiteDBConnection>;
983
- closeConnection(database: string): Promise<void>;
984
- isConnection(database: string): Promise<capSQLiteResult>;
985
- retrieveConnection(database: string): Promise<SQLiteDBConnection>;
1036
+ createConnection(database: string, encrypted: boolean, mode: string, version: number, readonly: boolean): Promise<SQLiteDBConnection>;
1037
+ closeConnection(database: string, readonly: boolean): Promise<void>;
1038
+ isConnection(database: string, readonly: boolean): Promise<capSQLiteResult>;
1039
+ retrieveConnection(database: string, readonly: boolean): Promise<SQLiteDBConnection>;
986
1040
  getNCDatabasePath(path: string, database: string): Promise<capNCDatabasePathResult>;
987
1041
  createNCConnection(databasePath: string, version: number): Promise<SQLiteDBConnection>;
988
1042
  closeNCConnection(databasePath: string): Promise<void>;
@@ -1012,6 +1066,12 @@ export interface ISQLiteDBConnection {
1012
1066
  * @since 2.9.0 refactor
1013
1067
  */
1014
1068
  getConnectionDBName(): string;
1069
+ /**
1070
+ * Get SQLite DB Connection read-only mode
1071
+ * @returns boolean
1072
+ * @since 4.1.0
1073
+ */
1074
+ getConnectionReadOnly(): boolean;
1015
1075
  /**
1016
1076
  * Open a SQLite DB Connection
1017
1077
  * @returns Promise<void>
@@ -1143,9 +1203,11 @@ export interface ISQLiteDBConnection {
1143
1203
  */
1144
1204
  export declare class SQLiteDBConnection implements ISQLiteDBConnection {
1145
1205
  private dbName;
1206
+ private readonly;
1146
1207
  private sqlite;
1147
- constructor(dbName: string, sqlite: any);
1208
+ constructor(dbName: string, readonly: boolean, sqlite: any);
1148
1209
  getConnectionDBName(): string;
1210
+ getConnectionReadOnly(): boolean;
1149
1211
  open(): Promise<void>;
1150
1212
  close(): Promise<void>;
1151
1213
  getUrl(): Promise<capSQLiteUrl>;