-
Notifications
You must be signed in to change notification settings - Fork 19
/
SQLite.pas
1116 lines (992 loc) · 65.8 KB
/
SQLite.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//////////////////////////////////////////////////
// TSQLite //
// Delphi SQLite3 wrapper //
// //
// https://github.com/stijnsanders/TSQLite //
//////////////////////////////////////////////////
unit SQLite;
//based on sqlite.h 3.45.0 2024-01-15
interface
uses SysUtils;
type
//object placeholders (=handles)
HSQLiteDB=type pointer;
HSQLiteStatement=type pointer;
HSQLiteValue=type pointer;
HSQLiteContext=type pointer;
HSQLiteBlob=type pointer;
HSQLiteMutex=type pointer;
HSQLiteBackup=type pointer;
type
TSQLiteCallback=function(Context:pointer;N:integer;var Text:PAnsiChar;var Names:PAnsiChar):integer; cdecl;
TSQLiteBusyHandler=function(Context:pointer;N:integer):integer; cdecl;
TSQLiteAuthorizer=function(UserData:pointer;Action:integer;X1,X2,X3,X4:PAnsiChar):integer; cdecl;
TSQLiteProcessHandler=function(Context:pointer):integer; cdecl;
TSQLiteDestructor=procedure(Data:pointer); cdecl;
TSQLiteFunctionHandler=procedure(Context:HSQLiteContext;Index:integer;Value:HSQLiteValue); cdecl;
TSQLiteFunctionFinal=procedure(Context:HSQLiteContext); cdecl;
TSQLiteCollationCompare=function(pArg:pointer;N:integer;X:PAnsiChar;Y:PAnsiChar):integer; cdecl;
TSQLiteCollationCompare16=function(pArg:pointer;N:integer;X:PWideChar;Y:PWideChar):integer; cdecl;
TSQLiteCollationNeeded=procedure(Context:pointer;SQLiteDB:HSQLiteDB;eTextRep:integer;X:PAnsiChar); cdecl;
TSQLiteCollationNeeded16=procedure(Context:pointer;SQLiteDB:HSQLiteDB;eTextRep:integer;X:PWideChar); cdecl;
TSQLiteHook=function(Context:pointer):integer; cdecl;
TSQLiteUpdateHook=procedure(Context:pointer;N:integer;X:PAnsiChar;Y:PAnsiChar;Z:int64); cdecl;
TSQLiteUnlockNotify=procedure(var apArg:pointer;nArg:integer); cdecl;
TSQLiteWriteAheadLogHook=function(Context:pointer;SQLiteDB:HSQLiteDB;X:PAnsiChar;N:integer):integer; cdecl;
const
SQLITE_OK = 0 ; // Successful result
SQLITE_ERROR = 1 ; // SQL error or missing database
SQLITE_INTERNAL = 2 ; // Internal logic error in SQLite
SQLITE_PERM = 3 ; // Access permission denied
SQLITE_ABORT = 4 ; // Callback routine requested an abort
SQLITE_BUSY = 5 ; // The database file is locked
SQLITE_LOCKED = 6 ; // A table in the database is locked
SQLITE_NOMEM = 7 ; // A malloc() failed
SQLITE_READONLY = 8 ; // Attempt to write a readonly database
SQLITE_INTERRUPT = 9 ; // Operation terminated by sqlite3_interrupt()
SQLITE_IOERR = 10 ; // Some kind of disk I/O error occurred
SQLITE_CORRUPT = 11 ; // The database disk image is malformed
SQLITE_NOTFOUND = 12 ; // NOT USED. Table or record not found
SQLITE_FULL = 13 ; // Insertion failed because database is full
SQLITE_CANTOPEN = 14 ; // Unable to open the database file
SQLITE_PROTOCOL = 15 ; // Database lock protocol error
SQLITE_EMPTY = 16 ; // Database is empty
SQLITE_SCHEMA = 17 ; // The database schema changed
SQLITE_TOOBIG = 18 ; // String or BLOB exceeds size limit
SQLITE_CONSTRAINT = 19 ; // Abort due to constraint violation
SQLITE_MISMATCH = 20 ; // Data type mismatch
SQLITE_MISUSE = 21 ; // Library used incorrectly
SQLITE_NOLFS = 22 ; // Uses OS features not supported on host
SQLITE_AUTH = 23 ; // Authorization denied
SQLITE_FORMAT = 24 ; // Auxiliary database format error
SQLITE_RANGE = 25 ; // 2nd parameter to sqlite3_bind out of range
SQLITE_NOTADB = 26 ; // File opened that is not a database file
SQLITE_NOTICE = 27 ; // Notifications from sqlite3_log()
SQLITE_WARNING = 28 ; // Warnings from sqlite3_log()
SQLITE_ROW = 100; // sqlite3_step() has another row ready
SQLITE_DONE = 101; // sqlite3_step() has finished executing
SQLITE_ERROR_MISSING_COLLSEQ = SQLITE_ERROR or $0100;
SQLITE_ERROR_RETRY = SQLITE_ERROR or $0200;
SQLITE_ERROR_SNAPSHOT = SQLITE_ERROR or $0300;
SQLITE_IOERR_READ = SQLITE_IOERR or $0100;
SQLITE_IOERR_SHORT_READ = SQLITE_IOERR or $0200;
SQLITE_IOERR_WRITE = SQLITE_IOERR or $0300;
SQLITE_IOERR_FSYNC = SQLITE_IOERR or $0400;
SQLITE_IOERR_DIR_FSYNC = SQLITE_IOERR or $0500;
SQLITE_IOERR_TRUNCATE = SQLITE_IOERR or $0600;
SQLITE_IOERR_FSTAT = SQLITE_IOERR or $0700;
SQLITE_IOERR_UNLOCK = SQLITE_IOERR or $0800;
SQLITE_IOERR_RDLOCK = SQLITE_IOERR or $0900;
SQLITE_IOERR_DELETE = SQLITE_IOERR or $1A00;
SQLITE_IOERR_BLOCKED = SQLITE_IOERR or $1B00;
SQLITE_IOERR_NOMEM = SQLITE_IOERR or $1C00;
SQLITE_IOERR_ACCESS = SQLITE_IOERR or $1D00;
SQLITE_IOERR_CHECKRESERVEDLOCK = SQLITE_IOERR or $1E00;
SQLITE_IOERR_LOCK = SQLITE_IOERR or $1F00;
SQLITE_IOERR_CLOSE = SQLITE_IOERR or $1000;
SQLITE_IOERR_DIR_CLOSE = SQLITE_IOERR or $1100;
SQLITE_IOERR_SHMOPEN = SQLITE_IOERR or $1200;
SQLITE_IOERR_SHMSIZE = SQLITE_IOERR or $1300;
SQLITE_IOERR_SHMLOCK = SQLITE_IOERR or $1400;
SQLITE_IOERR_SHMMAP = SQLITE_IOERR or $1500;
SQLITE_IOERR_SEEK = SQLITE_IOERR or $1600;
SQLITE_IOERR_DELETE_NOENT = SQLITE_IOERR or $1700;
SQLITE_IOERR_MMAP = SQLITE_IOERR or $1800;
SQLITE_IOERR_GETTEMPPATH = SQLITE_IOERR or $1900;
SQLITE_IOERR_CONVPATH = SQLITE_IOERR or $1A00;
SQLITE_IOERR_VNODE = SQLITE_IOERR or $1B00;
SQLITE_IOERR_AUTH = SQLITE_IOERR or $1C00;
SQLITE_IOERR_BEGIN_ATOMIC = SQLITE_IOERR or $1D00;
SQLITE_IOERR_COMMIT_ATOMIC = SQLITE_IOERR or $1E00;
SQLITE_IOERR_ROLLBACK_ATOMIC = SQLITE_IOERR or $1F00;
SQLITE_IOERR_DATA = SQLITE_IOERR or $2000;
SQLITE_IOERR_CORRUPTFS = SQLITE_IOERR or $2100;
SQLITE_IOERR_IN_PAGE = SQLITE_IOERR or $2200;
SQLITE_LOCKED_SHAREDCACHE = SQLITE_LOCKED or $0100;
SQLITE_BUSY_RECOVERY = SQLITE_BUSY or $0100;
SQLITE_BUSY_SNAPSHOT = SQLITE_BUSY or $0200;
SQLITE_BUSY_TIMEOUT = SQLITE_BUSY or $0300;
SQLITE_CANTOPEN_NOTEMPDIR = SQLITE_CANTOPEN or $0100;
SQLITE_CANTOPEN_ISDIR = SQLITE_CANTOPEN or $0200;
SQLITE_CANTOPEN_FULLPATH = SQLITE_CANTOPEN or $0300;
SQLITE_CANTOPEN_CONVPATH = SQLITE_CANTOPEN or $0400;
SQLITE_CANTOPEN_DIRTYWAL = SQLITE_CANTOPEN or $0500; // Not Used
SQLITE_CANTOPEN_SYMLINK = SQLITE_CANTOPEN or $0600;
SQLITE_CORRUPT_VTAB = SQLITE_CORRUPT or $0100;
SQLITE_CORRUPT_SEQUENCE = SQLITE_CORRUPT or $0200;
SQLITE_CORRUPT_INDEX = SQLITE_CORRUPT or $0300;
SQLITE_READONLY_RECOVERY = SQLITE_READONLY or $0100;
SQLITE_READONLY_CANTLOCK = SQLITE_READONLY or $0200;
SQLITE_READONLY_ROLLBACK = SQLITE_READONLY or $0300;
SQLITE_READONLY_DBMOVED = SQLITE_READONLY or $0400;
SQLITE_ABORT_ROLLBACK = SQLITE_ABORT or $0200;
SQLITE_CONSTRAINT_CHECK = SQLITE_CONSTRAINT or $0100;
SQLITE_CONSTRAINT_COMMITHOOK = SQLITE_CONSTRAINT or $0200;
SQLITE_CONSTRAINT_FOREIGNKEY = SQLITE_CONSTRAINT or $0300;
SQLITE_CONSTRAINT_FUNCTION = SQLITE_CONSTRAINT or $0400;
SQLITE_CONSTRAINT_NOTNULL = SQLITE_CONSTRAINT or $0500;
SQLITE_CONSTRAINT_PRIMARYKEY = SQLITE_CONSTRAINT or $0600;
SQLITE_CONSTRAINT_TRIGGER = SQLITE_CONSTRAINT or $0700;
SQLITE_CONSTRAINT_UNIQUE = SQLITE_CONSTRAINT or $0800;
SQLITE_CONSTRAINT_VTAB = SQLITE_CONSTRAINT or $0900;
SQLITE_CONSTRAINT_ROWID = SQLITE_CONSTRAINT or $0A00;
SQLITE_CONSTRAINT_PINNED = SQLITE_CONSTRAINT or $0B00;
SQLITE_CONSTRAINT_DATATYPE = SQLITE_CONSTRAINT or $0C00;
SQLITE_NOTICE_RECOVER_WAL = SQLITE_NOTICE or $0100;
SQLITE_NOTICE_RECOVER_ROLLBACK = SQLITE_NOTICE or $0200;
SQLITE_NOTICE_RBU = SQLITE_NOTICE or $0300;
SQLITE_WARNING_AUTOINDEX = SQLITE_WARNING or $0100;
SQLITE_AUTH_USER = SQLITE_AUTH or $0100;
SQLITE_OK_LOAD_PERMANENTLY = SQLITE_OK or $0100;
SQLITE_OK_SYMLINK = SQLITE_OK or $0200; // internal use only
SQLITE_OPEN_READONLY = $00000001; // Ok for sqlite3_open_v2()
SQLITE_OPEN_READWRITE = $00000002; // Ok for sqlite3_open_v2()
SQLITE_OPEN_CREATE = $00000004; // Ok for sqlite3_open_v2()
SQLITE_OPEN_DELETEONCLOSE = $00000008; // VFS only
SQLITE_OPEN_EXCLUSIVE = $00000010; // VFS only
SQLITE_OPEN_AUTOPROXY = $00000020; // VFS only
SQLITE_OPEN_URI = $00000040; // Ok for sqlite3_open_v2()
SQLITE_OPEN_MEMORY = $00000080; // Ok for sqlite3_open_v2()
SQLITE_OPEN_MAIN_DB = $00000100; // VFS only
SQLITE_OPEN_TEMP_DB = $00000200; // VFS only
SQLITE_OPEN_TRANSIENT_DB = $00000400; // VFS only
SQLITE_OPEN_MAIN_JOURNAL = $00000800; // VFS only
SQLITE_OPEN_TEMP_JOURNAL = $00001000; // VFS only
SQLITE_OPEN_SUBJOURNAL = $00002000; // VFS only
SQLITE_OPEN_SUPER_JOURNAL = $00004000; // VFS only
SQLITE_OPEN_NOMUTEX = $00008000; // Ok for sqlite3_open_v2()
SQLITE_OPEN_FULLMUTEX = $00010000; // Ok for sqlite3_open_v2()
SQLITE_OPEN_SHAREDCACHE = $00020000; // Ok for sqlite3_open_v2()
SQLITE_OPEN_PRIVATECACHE = $00040000; // Ok for sqlite3_open_v2()
SQLITE_OPEN_WAL = $00080000; // VFS only
SQLITE_OPEN_NOFOLLOW = $01000000; // Ok for sqlite3_open_v2()
SQLITE_OPEN_EXRESCODE = $02000000; // Extended result codes
// Legacy compatibility: */
SQLITE_OPEN_MASTER_JOURNAL = $00004000; // VFS only
SQLITE_IOCAP_ATOMIC = $00000001;
SQLITE_IOCAP_ATOMIC512 = $00000002;
SQLITE_IOCAP_ATOMIC1K = $00000004;
SQLITE_IOCAP_ATOMIC2K = $00000008;
SQLITE_IOCAP_ATOMIC4K = $00000010;
SQLITE_IOCAP_ATOMIC8K = $00000020;
SQLITE_IOCAP_ATOMIC16K = $00000040;
SQLITE_IOCAP_ATOMIC32K = $00000080;
SQLITE_IOCAP_ATOMIC64K = $00000100;
SQLITE_IOCAP_SAFE_APPEND = $00000200;
SQLITE_IOCAP_SEQUENTIAL = $00000400;
SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = $00000800;
SQLITE_IOCAP_POWERSAFE_OVERWRITE = $00001000;
SQLITE_IOCAP_IMMUTABLE = $00002000;
SQLITE_LOCK_NONE = 0; // xUnlock() only
SQLITE_LOCK_SHARED = 1; // xLock() or xUnlock()
SQLITE_LOCK_RESERVED = 2; // xLock() only
SQLITE_LOCK_PENDING = 3; // xLock() only
SQLITE_LOCK_EXCLUSIVE = 4; // xLock() only
SQLITE_SYNC_NORMAL = $00002;
SQLITE_SYNC_FULL = $00003;
SQLITE_SYNC_DATAONLY = $00010;
SQLITE_CONFIG_SINGLETHREAD = 1;
SQLITE_CONFIG_MULTITHREAD = 2;
SQLITE_CONFIG_SERIALIZED = 3;
SQLITE_CONFIG_MALLOC = 4;
SQLITE_CONFIG_GETMALLOC = 5;
SQLITE_CONFIG_SCRATCH = 6;
SQLITE_CONFIG_PAGECACHE = 7;
SQLITE_CONFIG_HEAP = 8;
SQLITE_CONFIG_MEMSTATUS = 9;
SQLITE_CONFIG_MUTEX = 10;
SQLITE_CONFIG_GETMUTEX = 11;
SQLITE_CONFIG_LOOKASIDE = 13;
SQLITE_CONFIG_PCACHE = 14;
SQLITE_CONFIG_GETPCACHE = 15;
SQLITE_CONFIG_LOG = 16;
SQLITE_CONFIG_URI = 17;
SQLITE_CONFIG_PCACHE2 = 18;
SQLITE_CONFIG_GETPCACHE2 = 19;
SQLITE_CONFIG_COVERING_INDEX_SCAN = 20;
SQLITE_CONFIG_SQLLOG = 21;
SQLITE_CONFIG_MMAP_SIZE = 22;
SQLITE_CONFIG_WIN32_HEAPSIZE = 23;
SQLITE_CONFIG_PCACHE_HDRSZ = 24;
SQLITE_CONFIG_PMASZ = 25;
SQLITE_CONFIG_STMTJRNL_SPILL = 26;
SQLITE_CONFIG_SMALL_MALLOC = 27;
SQLITE_CONFIG_SORTERREF_SIZE = 28;
SQLITE_CONFIG_MEMDB_MAXSIZE = 29;
SQLITE_DBCONFIG_LOOKASIDE = 1001;
SQLITE_DBCONFIG_ENABLE_FKEY = 1002;
SQLITE_DBCONFIG_ENABLE_TRIGGER = 1003;
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004;
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005;
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE = 1006;
SQLITE_DBCONFIG_ENABLE_QPSG = 1007;
SQLITE_DBCONFIG_TRIGGER_EQP = 1008;
SQLITE_DBCONFIG_RESET_DATABASE = 1009;
SQLITE_DBCONFIG_DEFENSIVE = 1010;
SQLITE_DBCONFIG_WRITABLE_SCHEMA = 1011;
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE = 1012;
SQLITE_DBCONFIG_DQS_DML = 1013;
SQLITE_DBCONFIG_DQS_DDL = 1014;
SQLITE_DBCONFIG_ENABLE_VIEW = 1015;
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT = 1016;
SQLITE_DBCONFIG_TRUSTED_SCHEMA = 1017;
SQLITE_DBCONFIG_STMT_SCANSTATUS = 1018;
SQLITE_DBCONFIG_REVERSE_SCANORDER = 1019;
SQLITE_DBCONFIG_MAX = 1019;
SQLITE_DENY = 1;
SQLITE_IGNORE = 2;
SQLITE_CREATE_INDEX = 1;
SQLITE_CREATE_TABLE = 2;
SQLITE_CREATE_TEMP_INDEX = 3;
SQLITE_CREATE_TEMP_TABLE = 4;
SQLITE_CREATE_TEMP_TRIGGER = 5;
SQLITE_CREATE_TEMP_VIEW = 6;
SQLITE_CREATE_TRIGGER = 7;
SQLITE_CREATE_VIEW = 8;
SQLITE_DELETE = 9;
SQLITE_DROP_INDEX = 10;
SQLITE_DROP_TABLE = 11;
SQLITE_DROP_TEMP_INDEX = 12;
SQLITE_DROP_TEMP_TABLE = 13;
SQLITE_DROP_TEMP_TRIGGER = 14;
SQLITE_DROP_TEMP_VIEW = 15;
SQLITE_DROP_TRIGGER = 16;
SQLITE_DROP_VIEW = 17;
SQLITE_INSERT = 18;
SQLITE_PRAGMA = 19;
SQLITE_READ = 20;
SQLITE_SELECT = 21;
SQLITE_TRANSACTION = 22;
SQLITE_UPDATE = 23;
SQLITE_ATTACH = 24;
SQLITE_DETACH = 25;
SQLITE_ALTER_TABLE = 26;
SQLITE_REINDEX = 27;
SQLITE_ANALYZE = 28;
SQLITE_CREATE_VTABLE = 29;
SQLITE_DROP_VTABLE = 30;
SQLITE_FUNCTION = 31;
SQLITE_SAVEPOINT = 32;
SQLITE_COPY = 0;
SQLITE_RECURSIVE = 33;
SQLITE_LIMIT_LENGTH = 0;
SQLITE_LIMIT_SQL_LENGTH = 1;
SQLITE_LIMIT_COLUMN = 2;
SQLITE_LIMIT_EXPR_DEPTH = 3;
SQLITE_LIMIT_COMPOUND_SELECT = 4;
SQLITE_LIMIT_VDBE_OP = 5;
SQLITE_LIMIT_FUNCTION_ARG = 6;
SQLITE_LIMIT_ATTACHED = 7;
SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8;
SQLITE_LIMIT_VARIABLE_NUMBER = 9;
SQLITE_LIMIT_TRIGGER_DEPTH = 10;
SQLITE_LIMIT_WORKER_THREADS = 11;
SQLITE_PREPARE_PERSISTENT = $01;
SQLITE_PREPARE_NORMALIZE = $02;
SQLITE_PREPARE_NO_VTAB = $04;
SQLITE_INTEGER = 1;
SQLITE_FLOAT = 2;
SQLITE_TEXT = 3;
SQLITE_BLOB = 4;
SQLITE_NULL = 5;
SQLITE_UTF8 = 1;
SQLITE_UTF16LE = 2;
SQLITE_UTF16BE = 3;
SQLITE_UTF16 = 4; // Use native byte order
SQLITE_ANY = 5; // sqlite3_create_function only
SQLITE_UTF16_ALIGNED = 8; // sqlite3_create_collation only
SQLITE_DETERMINISTIC = $000000800;
SQLITE_DIRECTONLY = $000080000;
SQLITE_SUBTYPE = $000100000;
SQLITE_INNOCUOUS = $000200000;
SQLITE_RESULT_SUBTYPE = $001000000;
SQLITE_MUTEX_FAST = 0;
SQLITE_MUTEX_RECURSIVE = 1;
SQLITE_MUTEX_STATIC_MASTER = 2;
SQLITE_MUTEX_STATIC_MEM = 3; // sqlite3_malloc()
SQLITE_MUTEX_STATIC_OPEN = 4; // sqlite3BtreeOpen()
SQLITE_MUTEX_STATIC_PRNG = 5; // sqlite3_random()
SQLITE_MUTEX_STATIC_LRU = 6; // lru page list
SQLITE_MUTEX_STATIC_LRU2 = 7;
SQLITE_MUTEX_STATIC_PMEM = 7; // sqlite3PageMalloc()
SQLITE_MUTEX_STATIC_APP1 = 8; // For use by application
SQLITE_MUTEX_STATIC_APP2 = 9; // For use by application
SQLITE_MUTEX_STATIC_APP3 = 10; // For use by application
SQLITE_MUTEX_STATIC_VFS1 = 11; // For use by built-in VFS
SQLITE_MUTEX_STATIC_VFS2 = 12; // For use by extension VFS
SQLITE_MUTEX_STATIC_VFS3 = 13; // For use by application VFS
SQLITE_STATUS_MEMORY_USED = 0;
SQLITE_STATUS_PAGECACHE_USED = 1;
SQLITE_STATUS_PAGECACHE_OVERFLOW = 2;
SQLITE_STATUS_SCRATCH_USED = 3;
SQLITE_STATUS_SCRATCH_OVERFLOW = 4;
SQLITE_STATUS_MALLOC_SIZE = 5;
SQLITE_STATUS_PARSER_STACK = 6;
SQLITE_STATUS_PAGECACHE_SIZE = 7;
SQLITE_STATUS_SCRATCH_SIZE = 8;
SQLITE_STATUS_MALLOC_COUNT = 9;
SQLITE_DBSTATUS_LOOKASIDE_USED = 0;
SQLITE_DBSTATUS_CACHE_USED = 1;
SQLITE_DBSTATUS_SCHEMA_USED = 2;
SQLITE_DBSTATUS_STMT_USED = 3;
SQLITE_DBSTATUS_LOOKASIDE_HIT = 4;
SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE = 5;
SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL = 6;
SQLITE_DBSTATUS_CACHE_HIT = 7;
SQLITE_DBSTATUS_CACHE_MISS = 8;
SQLITE_DBSTATUS_CACHE_WRITE = 9;
SQLITE_DBSTATUS_DEFERRED_FKS = 10;
SQLITE_DBSTATUS_CACHE_USED_SHARED = 11;
SQLITE_DBSTATUS_CACHE_SPILL = 12;
SQLITE_DBSTATUS_MAX = 12; // Largest defined DBSTATUS
SQLITE_STMTSTATUS_FULLSCAN_STEP = 1;
SQLITE_STMTSTATUS_SORT = 2;
SQLITE_STMTSTATUS_AUTOINDEX = 3;
SQLITE_STMTSTATUS_VM_STEP = 4;
SQLITE_STMTSTATUS_REPREPARE = 5;
SQLITE_STMTSTATUS_RUN = 6;
SQLITE_STMTSTATUS_FILTER_MISS = 7;
SQLITE_STMTSTATUS_FILTER_HIT = 8;
SQLITE_STMTSTATUS_MEMUSED = 99;
SQLITE_CHECKPOINT_PASSIVE = 0;
SQLITE_CHECKPOINT_FULL = 1;
SQLITE_CHECKPOINT_RESTART = 2;
SQLITE_CHECKPOINT_TRUNCATE = 3;
SQLITE_SCANSTAT_NLOOP = 0;
SQLITE_SCANSTAT_NVISIT = 1;
SQLITE_SCANSTAT_EST = 2;
SQLITE_SCANSTAT_NAME = 3;
SQLITE_SCANSTAT_EXPLAIN = 4;
SQLITE_SCANSTAT_SELECTID = 5;
SQLITE_SCANSTAT_PARENTID = 6;
SQLITE_SCANSTAT_NCYCLE = 7;
SQLITE_SCANSTAT_COMPLEX = $0001;
type
ESQLiteException=class(Exception)
private
FErrorCode:integer;
public
constructor Create(ErrorCode:integer);
constructor CreateDB(SQLiteDB:HSQLiteDB;ErrorCode:integer);
property ErrorCode:integer read FErrorCode;
end;
{$IF not(Defined(uint64))}type uint64=int64;{$IFEND}
{$IF (CompilerVersion >= 16) and (defined(Win32) OR defined(Win64))}
{$DEFINE DELAYED_DLL_LOAD }
{$WARN symbol_platform OFF}
{$IFEND}
//ATTENTION: PAnsiChar's should point to UTF-8 strings
//ATTENTION: if you need to pass a NULL pointer to a 'var PAnsiChar' parameter, use 'PAnsiChar(nil^)'
type
Tsqlite3_filename=type PAnsiChar;
procedure sqlite3_check(Res:integer); overload;
procedure sqlite3_check(SQLiteDB:HSQLiteDB;Res:integer); overload;
function sqlite3_libversion:PAnsiChar; cdecl;
function sqlite3_sourceid:PAnsiChar; cdecl;
function sqlite3_libversion_number:integer; cdecl;
//function sqlite3_compileoption_used(PAnsiChar:zOptName):integer; cdecl;
//function sqlite3_compileoption_get(N:integer):PAnsiChar; cdecl;
function sqlite3_threadsafe:integer; cdecl;
function sqlite3_close(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_close_v2(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_exec(SQLiteDB:HSQLiteDB;Sql:PAnsiChar;Callback:TSQLiteCallback;Context:pointer;
var ErrorMessage:PAnsiChar):integer; cdecl;
function sqlite3_initialize:integer; cdecl;
function sqlite3_shutdown:integer; cdecl;
function sqlite3_os_init:integer; cdecl;
function sqlite3_os_end:integer; cdecl;
function sqlite3_config(op:integer):integer; cdecl; varargs;
function sqlite3_db_config(SQLiteDB:HSQLiteDB;op:integer):integer; cdecl; varargs;
function sqlite3_extended_result_codes(SQLiteDB:HSQLiteDB;onoff:integer):integer; cdecl;
function sqlite3_last_insert_rowid(SQLiteDB:HSQLiteDB):int64; cdecl;
//procedure sqlite3_set_last_insert_rowid(SQLiteDB:HSQLiteDB;id:int64); cdecl;
function sqlite3_changes(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_changes64(SQLiteDB:HSQLiteDB):int64; cdecl;
function sqlite3_total_changes(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_total_changes64(SQLiteDB:HSQLiteDB):int64; cdecl;
procedure sqlite3_interrupt(SQLiteDB:HSQLiteDB); cdecl;
function sqlite3_is_interrupted(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_complete(sql:PAnsiChar):integer; cdecl;
function sqlite3_complete16(sql:PWideChar):integer; cdecl;
function sqlite3_busy_handler(SQLiteDB:HSQLiteDB;Handler:TSQLiteBusyHandler;Context:pointer):integer; cdecl;
function sqlite3_busy_timeout(SQLiteDB:HSQLiteDB;ms:integer):integer; cdecl;
function sqlite3_get_table(SQLiteDB:HSQLiteDB;Sql:PAnsiChar;
var Results:PAnsiChar;var Rows:integer;var Columns:integer;var ErrorMessage:PAnsiChar):integer; cdecl;
function sqlite3_free_table(Results:PAnsiChar):integer; cdecl;
//function sqlite3_mprintf(:PAnsiChar;...):PAnsiChar; cdecl;
//function sqlite3_vmprintf(:PAnsiChar;va_list):integer; cdecl;
//function sqlite3_snprintf(:integer;:PAnsiChar;:PAnsiChar;...):integer; cdecl;
function sqlite3_malloc(Size:integer):pointer; cdecl;
function sqlite3_malloc64(Size:uint64):pointer; cdecl;
function sqlite3_realloc(Mem:pointer;Size:integer):pointer; cdecl;
function sqlite3_realloc64(Mem:pointer;Size:uint64):pointer; cdecl;
procedure sqlite3_free(Mem:pointer); cdecl;
function sqlite3_msize(Mem:pointer):uint64; cdecl;
function sqlite3_memory_used:int64; cdecl;
function sqlite3_memory_highwater(resetFlag:longbool):int64; cdecl;
procedure sqlite3_randomness(N:integer;var P); cdecl;
function sqlite3_set_authorizer(SQLiteDB:HSQLiteDB;Auth:TSQLiteAuthorizer;UserData:pointer):integer; cdecl;
procedure sqlite3_progress_handler(SQLiteDB:HSQLiteDB;N:integer;Callback:TSQLiteProcessHandler;Context:pointer); cdecl;
function sqlite3_open(FileName:PAnsiChar;var SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_open16(FileName:PWideChar;var SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_open_v2(FileName:PAnsiChar;var SQLiteDB:HSQLiteDB;Flags:integer;VFSModule:PAnsiChar):integer; cdecl;
function sqlite3_uri_parameter(FileName:Tsqlite3_filename;Param:PAnsiChar):PAnsiChar; cdecl;
function sqlite3_uri_boolean(FileName:Tsqlite3_filename;Param:PAnsiChar;Default:integer):integer; cdecl;
function sqlite3_uri_int64(FileName:Tsqlite3_filename;Param:PAnsiChar;Default:int64):int64 cdecl;
function sqlite3_uri_key(FileName:Tsqlite3_filename;N:integer):PAnsiChar; cdecl;
function sqlite3_filename_database(FileName:Tsqlite3_filename):PAnsiChar; cdecl;
function sqlite3_filename_journal(FileName:Tsqlite3_filename):PAnsiChar; cdecl;
function sqlite3_filename_wal(FileName:Tsqlite3_filename):PAnsiChar; cdecl;
//function sqlite3_database_file_object(FileName:PAnsiChar):Tsqlite3_file; cdecl;
function sqlite3_create_filename(zDatabase,zJournal,zWal:PAnsiChar;
nParam:integer;azParam:PPAnsiChar):Tsqlite3_filename; cdecl;
procedure sqlite3_free_filename(FileName:Tsqlite3_filename); cdecl;
function sqlite3_errcode(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_extended_errcode(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_errmsg(SQLiteDB:HSQLiteDB):PAnsiChar; cdecl;
function sqlite3_errmsg16(SQLiteDB:HSQLiteDB):PWideChar; cdecl;
function sqlite3_errstr(ResultCode:integer):PAnsiChar; cdecl;
function sqlite3_error_offset(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_limit(SQLiteDB:HSQLiteDB;id:integer;newVal:integer):integer; cdecl;
function sqlite3_prepare(SQLiteDB:HSQLiteDB;Sql:PAnsiChar;nByte:integer;
var Statement:HSQLiteStatement;var Tail:PAnsiChar):integer; cdecl;
function sqlite3_prepare_v2(SQLiteDB:HSQLiteDB;Sql:PAnsiChar;nByte:integer;
var Statement:HSQLiteStatement;var Tail:PAnsiChar):integer; cdecl;
function sqlite3_prepare_v3(SQLiteDB:HSQLiteDB;Sql:PAnsiChar;nByte:integer;
prepFlags:cardinal;var Statement:HSQLiteStatement;
var Tail:PAnsiChar):integer; cdecl;
function sqlite3_prepare16(SQLiteDB:HSQLiteDB;Sql:PWideChar;nByte:integer;
var Statement:HSQLiteStatement;var Tail:PWideChar):integer; cdecl;
function sqlite3_prepare16_v2(SQLiteDB:HSQLiteDB;Sql:PWideChar;nByte:integer;
var Statement:HSQLiteStatement;var Tail:PWideChar):integer; cdecl;
function sqlite3_prepare16_v3(SQLiteDB:HSQLiteDB;Sql:PWideChar;nByte:integer;
prepFlags:cardinal;var Statement:HSQLiteStatement;
var Tail:PWideChar):integer; cdecl;
function sqlite3_sql(Statement:HSQLiteStatement):PAnsiChar; cdecl;
function sqlite3_expanded_sql(Statement:HSQLiteStatement):PAnsiChar; cdecl;
function sqlite3_normalized_sql(Statement:HSQLiteStatement):PAnsiChar; cdecl;
function sqlite3_stmt_readonly(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_stmt_isexplain(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_stmt_busy(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_bind_blob(Statement:HSQLiteStatement;Index:integer;var X;N:integer;Z:TSQLiteDestructor):integer; cdecl;
function sqlite3_bind_blob64(Statement:HSQLiteStatement;Index:integer;var X;N:int64;Z:TSQLiteDestructor):integer; cdecl;
function sqlite3_bind_double(Statement:HSQLiteStatement;Index:integer;X:Double):integer; cdecl;
function sqlite3_bind_int(Statement:HSQLiteStatement;Index:integer;X:integer):integer; cdecl;
function sqlite3_bind_int64(Statement:HSQLiteStatement;Index:integer;X:uint64):integer; cdecl;
function sqlite3_bind_null(Statement:HSQLiteStatement;Index:integer):integer; cdecl;
function sqlite3_bind_text(Statement:HSQLiteStatement;Index:integer;
X:PAnsiChar;N:integer;Z:TSQLiteDestructor):integer; cdecl;
function sqlite3_bind_text16(Statement:HSQLiteStatement;Index:integer;
X:PWideChar;N:integer;Z:TSQLiteDestructor):integer; cdecl;
function sqlite3_bind_text64(Statement:HSQLiteStatement;Index:integer;
X:PWideChar;N:uint64;Z:TSQLiteDestructor):integer; cdecl;
function sqlite3_bind_value(Statement:HSQLiteStatement;Index:integer;X:HSQLiteValue):integer; cdecl;
function sqlite3_bind_pointer(Statement:HSQLiteStatement;Index:integer;P:pointer;T:PAnsiChar;D:TSQLiteDestructor):integer; cdecl;
function sqlite3_bind_zeroblob(Statement:HSQLiteStatement;Index:integer;N:integer):integer; cdecl;
function sqlite3_bind_zeroblob64(Statement:HSQLiteStatement;Index:integer;N:uint64):integer; cdecl;
function sqlite3_bind_parameter_count(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_bind_parameter_name(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_bind_parameter_index(Statement:HSQLiteStatement;Name:PAnsiChar):integer; cdecl;
function sqlite3_clear_bindings(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_column_count(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_column_name(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_column_name16(Statement:HSQLiteStatement;Index:integer):PWideChar; cdecl;
function sqlite3_column_database_name(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_column_database_name16(Statement:HSQLiteStatement;Index:integer):PWideChar; cdecl;
function sqlite3_column_table_name(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_column_table_name16(Statement:HSQLiteStatement;Index:integer):PWideChar; cdecl;
function sqlite3_column_origin_name(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_column_origin_name16(Statement:HSQLiteStatement;Index:integer):PWideChar; cdecl;
function sqlite3_column_decltype(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_column_decltype16(Statement:HSQLiteStatement;Index:integer):PWideChar; cdecl;
function sqlite3_step(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_data_count(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_column_blob(Statement:HSQLiteStatement;Index:integer):pointer; cdecl;
function sqlite3_column_bytes(Statement:HSQLiteStatement;Index:integer):integer; cdecl;
function sqlite3_column_bytes16(Statement:HSQLiteStatement;Index:integer):integer; cdecl;
function sqlite3_column_double(Statement:HSQLiteStatement;Index:integer):Double; cdecl;
function sqlite3_column_int(Statement:HSQLiteStatement;Index:integer):integer; cdecl;
function sqlite3_column_int64(Statement:HSQLiteStatement;Index:integer):int64; cdecl;
function sqlite3_column_text(Statement:HSQLiteStatement;Index:integer):PAnsiChar; cdecl;
function sqlite3_column_text16(Statement:HSQLiteStatement;Index:integer):PWideChar; cdecl;
function sqlite3_column_type(Statement:HSQLiteStatement;Index:integer):integer; cdecl;
function sqlite3_column_value(Statement:HSQLiteStatement;Index:integer):HSQLiteValue; cdecl;
function sqlite3_finalize(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_reset(Statement:HSQLiteStatement):integer; cdecl;
function sqlite3_create_function(SQLiteDB:HSQLiteDB;FunctionName:PAnsiChar;
nArg:integer;eTextRep:integer;pApp:pointer;
xFunc:TSQLiteFunctionHandler;xStep:TSQLiteFunctionHandler;xFinal:TSQLiteFunctionFinal):integer; cdecl;
function sqlite3_create_function16(SQLiteDB:HSQLiteDB;FunctionName:PAnsiChar;
nArg:integer;eTextRep:integer;pApp:pointer;
xFunc:TSQLiteFunctionHandler;xStep:TSQLiteFunctionHandler;xFinal:TSQLiteFunctionFinal):integer; cdecl;
function sqlite3_create_function_v2(SQLiteDB:HSQLiteDB;FunctionName:PAnsiChar;
nArg:integer;eTextRep:integer;pApp:pointer;
xFunc:TSQLiteFunctionHandler;xStep:TSQLiteFunctionHandler;xFinal:TSQLiteFunctionFinal;
xDestroy:TSQLiteDestructor):integer; cdecl;
function sqlite3_create_window_function(SQLiteDB:HSQLiteDB;FunctionName:PAnsiChar;
nArg:integer;eTextRep:integer;pApp:pointer;
xStep:TSQLiteFunctionHandler;xFinal:TSQLiteFunctionFinal;
xValue:TSQLiteFunctionFinal;xInverse:TSQLiteFunctionHandler;
xDestroy:TSQLiteDestructor):integer; cdecl;
function sqlite3_value_blob(Value:HSQLiteValue):pointer; cdecl;
function sqlite3_value_bytes(Value:HSQLiteValue):integer; cdecl;
function sqlite3_value_bytes16(Value:HSQLiteValue):integer; cdecl;
function sqlite3_value_double(Value:HSQLiteValue):double; cdecl;
function sqlite3_value_int(Value:HSQLiteValue):integer; cdecl;
function sqlite3_value_int64(Value:HSQLiteValue):int64; cdecl;
function sqlite3_value_pointer(Value:HSQLiteValue;T:PAnsiChar):pointer; cdecl;
function sqlite3_value_text(Value:HSQLiteValue):PAnsiChar; cdecl;
function sqlite3_value_text16(Value:HSQLiteValue):PWideChar; cdecl;
function sqlite3_value_text16le(Value:HSQLiteValue):PWideChar; cdecl;
function sqlite3_value_text16be(Value:HSQLiteValue):PWideChar; cdecl;
function sqlite3_value_type(Value:HSQLiteValue):integer; cdecl;
function sqlite3_value_numeric_type(Value:HSQLiteValue):integer; cdecl;
function sqlite3_value_nochange(Value:HSQLiteValue):integer; cdecl;
function sqlite3_value_frombind(Value:HSQLiteValue):integer; cdecl;
function sqlite3_aggregate_context(Context:HSQLiteContext;nBytes:integer):pointer; cdecl;
function sqlite3_user_data(Context:HSQLiteContext):pointer; cdecl;
function sqlite3_context_db_handle(Context:HSQLiteContext):HSQLiteDB; cdecl;
function sqlite3_get_auxdata(Context:HSQLiteContext;N:integer):pointer; cdecl;
procedure sqlite3_set_auxdata(Context:HSQLiteContext;N:integer;var X;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_blob(Context:HSQLiteContext;var X;N:integer;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_blob64(Context:HSQLiteContext;var X;N:uint64;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_double(Context:HSQLiteContext;X:Double); cdecl;
procedure sqlite3_result_error(Context:HSQLiteContext;X:PAnsiChar;N:integer); cdecl;
procedure sqlite3_result_error16(Context:HSQLiteContext;X:PWideChar;N:integer); cdecl;
procedure sqlite3_result_error_toobig(Context:HSQLiteContext); cdecl;
procedure sqlite3_result_error_nomem(Context:HSQLiteContext); cdecl;
procedure sqlite3_result_error_code(Context:HSQLiteContext;ErrorCode:integer); cdecl;
procedure sqlite3_result_int(Context:HSQLiteContext;X:integer); cdecl;
procedure sqlite3_result_int64(Context:HSQLiteContext;X:int64); cdecl;
procedure sqlite3_result_null(Context:HSQLiteContext); cdecl;
procedure sqlite3_result_text(Context:HSQLiteContext;X:PAnsiChar;N:integer;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_text64(Context:HSQLiteContext;X:PWideChar;N:uint64;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_text16(Context:HSQLiteContext;X:PWideChar;N:integer;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_text16le(Context:HSQLiteContext;X:PWideChar;N:integer;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_text16be(Context:HSQLiteContext;X:PWideChar;N:integer;Z:TSQLiteDestructor); cdecl;
procedure sqlite3_result_value(Context:HSQLiteContext;X:HSQLiteValue); cdecl;
procedure sqlite3_result_pointer(Context:HSQLiteContext;P:pointer;T:PAnsiChar;D:TSQLiteDestructor); cdecl;
procedure sqlite3_result_zeroblob(Context:HSQLiteContext;N:integer); cdecl;
function sqlite3_result_zeroblob64(Context:HSQLiteContext;N:uint64):integer; cdecl;
procedure sqlite3_result_subtype(Context:HSQLiteContext;N:cardinal); cdecl;
function sqlite3_create_collation(SQLiteDB:HSQLiteDB;Name:PAnsiChar;
eTextRep:integer;pArg:pointer;xCompare:TSQLiteCollationCompare):integer; cdecl;
function sqlite3_create_collation_v2(SQLiteDB:HSQLiteDB;Name:PAnsiChar;
eTextRep:integer;pArg:pointer;xCompare:TSQLiteCollationCompare;xDestroy:TSQLiteDestructor):integer; cdecl;
function sqlite3_create_collation16(SQLiteDB:HSQLiteDB;Name:PWideChar;
eTextRep:integer;pArg:pointer;xCompare:TSQLiteCollationCompare16):integer; cdecl;
function sqlite3_collation_needed(SQLiteDB:HSQLiteDB;Context:pointer;CallBack:TSQLiteCollationNeeded):integer; cdecl;
function sqlite3_collation_needed16(SQLiteDB:HSQLiteDB;Context:pointer;CallBack:TSQLiteCollationNeeded16):integer; cdecl;
//sqlite3_key
//sqlite3_key_v2
//sqlite3_rekey
//sqlite3_rekey_v2
//sqlite3_activate_see
//sqlite3_activate_cerod
function sqlite3_sleep(ms:integer):integer; cdecl;
function sqlite3_get_autocommit(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_db_handle(Statement:HSQLiteStatement):HSQLiteDB; cdecl;
function sqlite3_db_filename(SQLiteDB:HSQLiteDB;Name:PAnsiChar):Tsqlite3_filename; cdecl;
function sqlite3_db_readonly(SQLiteDB:HSQLiteDB;Name:PAnsiChar):integer; cdecl;
function sqlite3_next_stmt(SQLiteDB:HSQLiteDB;Statement:HSQLiteStatement):HSQLiteStatement; cdecl;
function sqlite3_commit_hook(SQLiteDB:HSQLiteDB;X:TSQLiteHook;Context:pointer):pointer; cdecl;
function sqlite3_rollback_hook(SQLiteDB:HSQLiteDB;X:TSQLiteDestructor;Context:pointer):pointer; cdecl;
function sqlite3_update_hook(SQLiteDB:HSQLiteDB;X:TSQLiteUpdateHook;Context:pointer):pointer; cdecl;
function sqlite3_enable_shared_cache(X:integer):integer; cdecl;
function sqlite3_release_memory(X:integer):integer; cdecl;
function sqlite3_db_release_memory(SQLiteDB:HSQLiteDB):integer; cdecl;
function sqlite3_soft_heap_limit64(N:int64):int64; cdecl;
function sqlite3_hard_heap_limit64(N:int64):int64; cdecl;
function sqlite3_table_column_metadata(SQLiteDB:HSQLiteDB;Name:PAnsiChar;TableName:PAnsiChar;ColumnName:PAnsiChar;
var DataType:PAnsiChar;var CollationSequence:PAnsiChar;
var NotNull:integer;var PrimaryKey:integer;var AutoInc:integer):integer; cdecl;
function sqlite3_load_extension(SQLiteDB:HSQLiteDB;xFile:PAnsiChar;xProc:PAnsiChar;
var ErrorMessage:PAnsiChar):integer; cdecl;
function sqlite3_enable_load_extension(SQLiteDB:HSQLiteDB;onoff:integer):integer; cdecl;
//sqlite3_auto_extension
//sqlite3_cancel_auto_extension
//sqlite3_reset_auto_extension
//TODO: virtual table modules
//sqlite3_create_module
//sqlite3_create_module_v2
//sqlite3_drop_modules
//sqlite3_declare_vtab
//sqlite3_overload_function
function sqlite3_blob_open(SQLiteDB:HSQLiteDB;DB:PAnsiChar;TableName:PAnsiChar;ColumnName:PAnsiChar;Row:int64;Flags:integer;Blob:HSQLiteBlob):integer; cdecl;
function sqlite3_blob_reopen(Blob:HSQLiteBlob;N:int64):integer; cdecl;
function sqlite3_blob_close(Blob:HSQLiteBlob):integer; cdecl;
function sqlite3_blob_bytes(Blob:HSQLiteBlob):integer; cdecl;
function sqlite3_blob_read(Blob:HSQLiteBlob;var Z;N:integer;Offset:integer):integer; cdecl;
function sqlite3_blob_write(Blob:HSQLiteBlob;var Z;N:integer;Offset:integer):integer; cdecl;
//TODO: sqlite3_file
//TODO: sqlite3_io_methods
//sqlite3_vfs_find
//sqlite3_vfs_register
//sqlite3_vfs_unregister
function sqlite3_mutex_alloc(X:integer):HSQLiteBlob; cdecl;
procedure sqlite3_mutex_free(Mutex:HSQLiteMutex); cdecl;
procedure sqlite3_mutex_enter(Mutex:HSQLiteMutex); cdecl;
function sqlite3_mutex_try(Mutex:HSQLiteMutex):integer; cdecl;
procedure sqlite3_mutex_leave(Mutex:HSQLiteMutex); cdecl;
//sqlite3_mutex_held
//sqlite3_mutex_notheld
function sqlite3_db_mutex(SQLiteDB:HSQLiteDB):HSQLiteMutex; cdecl;
function sqlite3_file_control(SQLiteDB:HSQLiteDB;Name:PAnsiChar;Op:integer;X:pointer):integer; cdecl;
//sqlite3_test_control
function sqlite3_status(Op:integer;var Current:integer;var HighWater:integer;ResetFlag:integer):integer; cdecl;
function sqlite3_status64(Op:integer;var Current:int64;var HighWater:int64;ResetFlag:integer):integer; cdecl;
function sqlite3_db_status(SQLiteDB:HSQLiteDB;Op:integer;var Current:integer;var HighWater:integer;ResetFlag:integer):integer; cdecl;
function sqlite3_stmt_status(Statement:HSQLiteStatement;Op:integer;ResetFlag:integer):integer; cdecl;
function sqlite3_backup_init(Dest:HSQLiteDB;DestName:PAnsiChar;Source:HSQLiteDB;SourceName:PAnsiChar):HSQLiteBackup; cdecl;
function sqlite3_backup_step(Backup:HSQLiteBackup;Page:integer):integer; cdecl;
function sqlite3_backup_finish(Backup:HSQLiteBackup):integer; cdecl;
function sqlite3_backup_remaining(Backup:HSQLiteBackup):integer; cdecl;
function sqlite3_backup_pagecount(Backup:HSQLiteBackup):integer; cdecl;
function sqlite3_unlock_notify(Blocked:HSQLiteDB;xNotify:TSQLiteUnlockNotify;Context:pointer):integer; cdecl;
function sqlite3_stricmp(X:PAnsiChar;Y:PAnsiChar):integer; cdecl;
function sqlite3_strnicmp(X:PAnsiChar;Y:PAnsiChar;Z:integer):integer; cdecl;
function sqlite3_strglob(X:PAnsiChar;Y:PAnsiChar):integer; cdecl;
//sqlite3_log (cdecl)
function sqlite3_wal_hook(SQLiteDB:HSQLiteDB;Hook:TSQLiteWriteAheadLogHook;Context:pointer):pointer; cdecl;
function sqlite3_wal_autocheckpoint(SQLiteDB:HSQLiteDB;N:integer):integer; cdecl;
function sqlite3_wal_checkpoint(SQLiteDB:HSQLiteDB;DB:PAnsiChar):integer; cdecl;
function sqlite3_wal_checkpoint_v2(SQLiteDB:HSQLiteDB;DB:PAnsiChar;EMode:integer;var Log:integer;var Ckpt:integer):integer; cdecl;
//sqlite3_vtab_*: see SQLiteEx.pas
function sqlite3_stmt_scanstatus(Statement:HSQLiteStatement;Idx:integer;
iScanStatusOp:integer;pOut:pointer):integer; cdecl;
function sqlite3_stmt_scanstatus_v2(Statement:HSQLiteStatement;Idx:integer;
iScanStatusOp,flags:integer;pOut:pointer):integer; cdecl;
procedure sqlite3_stmt_scanstatus_reset(Statement:HSQLiteStatement); cdecl;
function sqlite3_db_cacheflush(SQLiteDB:HSQLiteDB):integer; cdecl;
//sqlite3_preupdate_*: see SQLiteEx.pas
function sqlite3_system_errno(SQLiteDB:HSQLiteDB):integer; cdecl;
//sqlite3_snapshot_*: see SQLiteEx.pas
//sqlite3_rtree_*: see SQLiteEx.pas
//sqlite3session_*: see SQLiteEx.pas
//sqlite3changeset_*: see SQLiteEx.pas
//sqlite3changegroup_*: see SQLiteEx.pas
//fts5: see SQLiteEx.pas
implementation
const
Sqlite3Dll='sqlite3.dll';
function sqlite3_libversion; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_sourceid; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_libversion_number; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//function sqlite3_compileoption_used; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//function sqlite3_compileoption_get; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_threadsafe; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_close; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_close_v2; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_exec; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_initialize; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_shutdown; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_os_init; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_os_end; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_config; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_db_config; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_extended_result_codes; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_last_insert_rowid; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//procedure sqlite3_set_last_insert_rowid; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_changes; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_changes64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_total_changes; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_total_changes64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_interrupt; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_is_interrupted; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_complete; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_complete16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_busy_handler; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_busy_timeout; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_get_table; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_free_table; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//function sqlite3_mprintf; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//function sqlite3_vmprintf; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//function sqlite3_snprintf; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_malloc; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_malloc64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_realloc; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_realloc64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_free; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_msize; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_memory_used; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_memory_highwater; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_randomness; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_set_authorizer; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//sqlite3_trace
procedure sqlite3_progress_handler; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_open; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_open16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_open_v2; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_uri_parameter; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_uri_boolean; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_uri_int64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_uri_key; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_filename_database; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_filename_journal; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_filename_wal; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//function sqlite3_database_file_object; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_filename; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_free_filename; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_errcode; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_extended_errcode; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_errmsg; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_errmsg16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_errstr; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_error_offset; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_limit; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_prepare; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_prepare_v2; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_prepare_v3; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_prepare16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_prepare16_v2; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_prepare16_v3; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_sql; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_expanded_sql; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_normalized_sql; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_stmt_readonly; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_stmt_isexplain; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_stmt_busy; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_blob; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_blob64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_double; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_int; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_int64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_null; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_text; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_text16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_text64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_value; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_pointer; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_zeroblob; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_zeroblob64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_parameter_count; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_parameter_name; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_bind_parameter_index; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_clear_bindings; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_count; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_name; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_name16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_database_name; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_database_name16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_table_name; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_table_name16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_origin_name; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_origin_name16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_decltype; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_decltype16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_step; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_data_count; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_blob; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_bytes; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_bytes16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_double; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_int; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_int64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_text; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_text16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_type; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_column_value; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_finalize; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_reset; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_function; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_function16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_function_v2; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_window_function; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_blob; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_bytes; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_bytes16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_double; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_int; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_int64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_pointer; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_text; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_text16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_text16le; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_text16be; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_type; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_numeric_type; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_nochange; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_value_frombind; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_aggregate_context; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_user_data; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_context_db_handle; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_get_auxdata; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_set_auxdata; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_blob; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_blob64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_double; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_error; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_error16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_error_toobig; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_error_nomem; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_error_code; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_int; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_int64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_null; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_text; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_text64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_text16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_text16le; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_text16be; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_value; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_pointer; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_zeroblob; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_result_zeroblob64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_result_subtype; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_collation; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_collation_v2; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_create_collation16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_collation_needed; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_collation_needed16; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//sqlite3_key
//sqlite3_rekey
//sqlite3_activate_cerod
function sqlite3_sleep; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_get_autocommit; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_db_handle; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_db_filename; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_db_readonly; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_next_stmt; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_commit_hook; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_rollback_hook; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_update_hook; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_enable_shared_cache; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_release_memory; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_db_release_memory; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_soft_heap_limit64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_hard_heap_limit64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_table_column_metadata; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_load_extension; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_enable_load_extension; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//sqlite3_auto_extension
//sqlite3_reset_auto_extension
//TODO: virtual table modules
//sqlite3_create_module
//sqlite3_create_module_v2
//sqlite3_declare_vtab
//sqlite3_overload_function
function sqlite3_blob_open; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_blob_reopen; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_blob_close; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_blob_bytes; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_blob_read; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_blob_write; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//sqlite3_vfs_find
//sqlite3_vfs_register
//sqlite3_vfs_unregister
function sqlite3_mutex_alloc; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_mutex_free; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_mutex_enter; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_mutex_try; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
procedure sqlite3_mutex_leave; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//sqlite3_mutex_held
//sqlite3_mutex_notheld
function sqlite3_db_mutex; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_file_control; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
//sqlite3_test_control
function sqlite3_status; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_status64; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_db_status; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};
function sqlite3_stmt_status; external Sqlite3Dll {$IF DEFINED(DELAYED_DLL_LOAD)} delayed {$IFEND};