@op-engineering/op-sqlite 2.0.16 → 2.0.18
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.
- package/README.md +31 -5
- package/android/build.gradle +4 -0
- package/cpp/PreparedStatementHostObject.cpp +3 -3
- package/cpp/bindings.cpp +48 -44
- package/cpp/bridge.cpp +101 -129
- package/cpp/bridge.h +53 -49
- package/cpp/sqlbatchexecutor.cpp +6 -6
- package/cpp/sqlite3.c +5642 -2573
- package/cpp/sqlite3.h +127 -31
- package/cpp/utils.cpp +5 -5
- package/op-sqlite.podspec +8 -1
- package/package.json +1 -1
package/cpp/sqlite3.h
CHANGED
|
@@ -145,11 +145,11 @@ extern "C" {
|
|
|
145
145
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
146
146
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
147
147
|
*/
|
|
148
|
-
#define SQLITE_VERSION "3.
|
|
149
|
-
#define SQLITE_VERSION_NUMBER
|
|
148
|
+
#define SQLITE_VERSION "3.45.1"
|
|
149
|
+
#define SQLITE_VERSION_NUMBER 3045001
|
|
150
150
|
#define SQLITE_SOURCE_ID \
|
|
151
|
-
"
|
|
152
|
-
"
|
|
151
|
+
"2024-01-30 16:01:20 " \
|
|
152
|
+
"e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257cc467a"
|
|
153
153
|
|
|
154
154
|
/*
|
|
155
155
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -3954,15 +3954,17 @@ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
|
|
|
3954
3954
|
** </ul>
|
|
3955
3955
|
**
|
|
3956
3956
|
** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
|
|
3957
|
-
** text that describes the error, as either UTF-8 or UTF-16 respectively
|
|
3957
|
+
** text that describes the error, as either UTF-8 or UTF-16 respectively,
|
|
3958
|
+
** or NULL if no error message is available.
|
|
3958
3959
|
** (See how SQLite handles [invalid UTF] for exceptions to this rule.)
|
|
3959
3960
|
** ^(Memory to hold the error message string is managed internally.
|
|
3960
3961
|
** The application does not need to worry about freeing the result.
|
|
3961
3962
|
** However, the error string might be overwritten or deallocated by
|
|
3962
3963
|
** subsequent calls to other SQLite interface functions.)^
|
|
3963
3964
|
**
|
|
3964
|
-
** ^The sqlite3_errstr() interface returns the English-language text
|
|
3965
|
-
** that describes the [result code], as UTF-8
|
|
3965
|
+
** ^The sqlite3_errstr(E) interface returns the English-language text
|
|
3966
|
+
** that describes the [result code] E, as UTF-8, or NULL if E is not an
|
|
3967
|
+
** result code for which a text error message is available.
|
|
3966
3968
|
** ^(Memory to hold the error message string is managed internally
|
|
3967
3969
|
** and must not be freed by the application)^.
|
|
3968
3970
|
**
|
|
@@ -5556,13 +5558,27 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5556
5558
|
** </dd>
|
|
5557
5559
|
**
|
|
5558
5560
|
** [[SQLITE_SUBTYPE]] <dt>SQLITE_SUBTYPE</dt><dd>
|
|
5559
|
-
** The SQLITE_SUBTYPE flag indicates to SQLite that a function
|
|
5561
|
+
** The SQLITE_SUBTYPE flag indicates to SQLite that a function might call
|
|
5560
5562
|
** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
|
|
5561
|
-
**
|
|
5562
|
-
**
|
|
5563
|
-
**
|
|
5564
|
-
**
|
|
5565
|
-
**
|
|
5563
|
+
** This flag instructs SQLite to omit some corner-case optimizations that
|
|
5564
|
+
** might disrupt the operation of the [sqlite3_value_subtype()] function,
|
|
5565
|
+
** causing it to return zero rather than the correct subtype().
|
|
5566
|
+
** SQL functions that invokes [sqlite3_value_subtype()] should have this
|
|
5567
|
+
** property. If the SQLITE_SUBTYPE property is omitted, then the return
|
|
5568
|
+
** value from [sqlite3_value_subtype()] might sometimes be zero even though
|
|
5569
|
+
** a non-zero subtype was specified by the function argument expression.
|
|
5570
|
+
**
|
|
5571
|
+
** [[SQLITE_RESULT_SUBTYPE]] <dt>SQLITE_RESULT_SUBTYPE</dt><dd>
|
|
5572
|
+
** The SQLITE_RESULT_SUBTYPE flag indicates to SQLite that a function might call
|
|
5573
|
+
** [sqlite3_result_subtype()] to cause a sub-type to be associated with its
|
|
5574
|
+
** result.
|
|
5575
|
+
** Every function that invokes [sqlite3_result_subtype()] should have this
|
|
5576
|
+
** property. If it does not, then the call to [sqlite3_result_subtype()]
|
|
5577
|
+
** might become a no-op if the function is used as term in an
|
|
5578
|
+
** [expression index]. On the other hand, SQL functions that never invoke
|
|
5579
|
+
** [sqlite3_result_subtype()] should avoid setting this property, as the
|
|
5580
|
+
** purpose of this property is to disable certain optimizations that are
|
|
5581
|
+
** incompatible with subtypes.
|
|
5566
5582
|
** </dd>
|
|
5567
5583
|
** </dl>
|
|
5568
5584
|
*/
|
|
@@ -5570,6 +5586,7 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5570
5586
|
#define SQLITE_DIRECTONLY 0x000080000
|
|
5571
5587
|
#define SQLITE_SUBTYPE 0x000100000
|
|
5572
5588
|
#define SQLITE_INNOCUOUS 0x000200000
|
|
5589
|
+
#define SQLITE_RESULT_SUBTYPE 0x001000000
|
|
5573
5590
|
|
|
5574
5591
|
/*
|
|
5575
5592
|
** CAPI3REF: Deprecated Functions
|
|
@@ -5769,6 +5786,12 @@ SQLITE_API int sqlite3_value_encoding(sqlite3_value *);
|
|
|
5769
5786
|
** information can be used to pass a limited amount of context from
|
|
5770
5787
|
** one SQL function to another. Use the [sqlite3_result_subtype()]
|
|
5771
5788
|
** routine to set the subtype for the return value of an SQL function.
|
|
5789
|
+
**
|
|
5790
|
+
** Every [application-defined SQL function] that invoke this interface
|
|
5791
|
+
** should include the [SQLITE_SUBTYPE] property in the text
|
|
5792
|
+
** encoding argument when the function is [sqlite3_create_function|registered].
|
|
5793
|
+
** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype()
|
|
5794
|
+
** might return zero instead of the upstream subtype in some corner cases.
|
|
5772
5795
|
*/
|
|
5773
5796
|
SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *);
|
|
5774
5797
|
|
|
@@ -5901,14 +5924,22 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *);
|
|
|
5901
5924
|
** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
|
|
5902
5925
|
** parameter)^, or
|
|
5903
5926
|
** <li> ^(during the original sqlite3_set_auxdata() call when a memory
|
|
5904
|
-
** allocation error occurs.)^
|
|
5927
|
+
** allocation error occurs.)^
|
|
5928
|
+
** <li> ^(during the original sqlite3_set_auxdata() call if the function
|
|
5929
|
+
** is evaluated during query planning instead of during query execution,
|
|
5930
|
+
** as sometimes happens with [SQLITE_ENABLE_STAT4].)^ </ul>
|
|
5905
5931
|
**
|
|
5906
|
-
** Note the last
|
|
5932
|
+
** Note the last two bullets in particular. The destructor X in
|
|
5907
5933
|
** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
|
|
5908
5934
|
** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
|
|
5909
5935
|
** should be called near the end of the function implementation and the
|
|
5910
5936
|
** function implementation should not make any use of P after
|
|
5911
|
-
** sqlite3_set_auxdata() has been called.
|
|
5937
|
+
** sqlite3_set_auxdata() has been called. Furthermore, a call to
|
|
5938
|
+
** sqlite3_get_auxdata() that occurs immediately after a corresponding call
|
|
5939
|
+
** to sqlite3_set_auxdata() might still return NULL if an out-of-memory
|
|
5940
|
+
** condition occurred during the sqlite3_set_auxdata() call or if the
|
|
5941
|
+
** function is being evaluated during query planning rather than during
|
|
5942
|
+
** query execution.
|
|
5912
5943
|
**
|
|
5913
5944
|
** ^(In practice, auxiliary data is preserved between function calls for
|
|
5914
5945
|
** function parameters that are compile-time constants, including literal
|
|
@@ -6190,6 +6221,20 @@ SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context *, sqlite3_uint64 n);
|
|
|
6190
6221
|
** higher order bits are discarded.
|
|
6191
6222
|
** The number of subtype bytes preserved by SQLite might increase
|
|
6192
6223
|
** in future releases of SQLite.
|
|
6224
|
+
**
|
|
6225
|
+
** Every [application-defined SQL function] that invokes this interface
|
|
6226
|
+
** should include the [SQLITE_RESULT_SUBTYPE] property in its
|
|
6227
|
+
** text encoding argument when the SQL function is
|
|
6228
|
+
** [sqlite3_create_function|registered]. If the [SQLITE_RESULT_SUBTYPE]
|
|
6229
|
+
** property is omitted from the function that invokes sqlite3_result_subtype(),
|
|
6230
|
+
** then in some cases the sqlite3_result_subtype() might fail to set
|
|
6231
|
+
** the result subtype.
|
|
6232
|
+
**
|
|
6233
|
+
** If SQLite is compiled with -DSQLITE_STRICT_SUBTYPE=1, then any
|
|
6234
|
+
** SQL function that invokes the sqlite3_result_subtype() interface
|
|
6235
|
+
** and that does not have the SQLITE_RESULT_SUBTYPE property will raise
|
|
6236
|
+
** an error. Future versions of SQLite might enable -DSQLITE_STRICT_SUBTYPE=1
|
|
6237
|
+
** by default.
|
|
6193
6238
|
*/
|
|
6194
6239
|
SQLITE_API void sqlite3_result_subtype(sqlite3_context *, unsigned int);
|
|
6195
6240
|
|
|
@@ -7370,17 +7415,17 @@ struct sqlite3_index_info {
|
|
|
7370
7415
|
unsigned char op; /* Constraint operator */
|
|
7371
7416
|
unsigned char usable; /* True if this constraint is usable */
|
|
7372
7417
|
int iTermOffset; /* Used internally - xBestIndex should ignore */
|
|
7373
|
-
} *
|
|
7418
|
+
} *aConstraint; /* Table of WHERE clause constraints */
|
|
7374
7419
|
int nOrderBy; /* Number of terms in the ORDER BY clause */
|
|
7375
7420
|
struct sqlite3_index_orderby {
|
|
7376
7421
|
int iColumn; /* Column number */
|
|
7377
7422
|
unsigned char desc; /* True for DESC. False for ASC. */
|
|
7378
|
-
} *
|
|
7423
|
+
} *aOrderBy; /* The ORDER BY clause */
|
|
7379
7424
|
/* Outputs */
|
|
7380
7425
|
struct sqlite3_index_constraint_usage {
|
|
7381
7426
|
int argvIndex; /* if >0, constraint is part of argv to xFilter */
|
|
7382
7427
|
unsigned char omit; /* Do not code a test for this constraint */
|
|
7383
|
-
} *
|
|
7428
|
+
} *aConstraintUsage;
|
|
7384
7429
|
int idxNum; /* Number used to identify the index */
|
|
7385
7430
|
char *idxStr; /* String, possibly obtained from sqlite3_malloc */
|
|
7386
7431
|
int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
|
|
@@ -7968,9 +8013,11 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *);
|
|
|
7968
8013
|
**
|
|
7969
8014
|
** ^(Some systems (for example, Windows 95) do not support the operation
|
|
7970
8015
|
** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try()
|
|
7971
|
-
** will always return SQLITE_BUSY.
|
|
7972
|
-
** sqlite3_mutex_try() as an optimization so this is acceptable
|
|
7973
|
-
** behavior.
|
|
8016
|
+
** will always return SQLITE_BUSY. In most cases the SQLite core only uses
|
|
8017
|
+
** sqlite3_mutex_try() as an optimization, so this is acceptable
|
|
8018
|
+
** behavior. The exceptions are unix builds that set the
|
|
8019
|
+
** SQLITE_ENABLE_SETLK_TIMEOUT build option. In that case a working
|
|
8020
|
+
** sqlite3_mutex_try() is required.)^
|
|
7974
8021
|
**
|
|
7975
8022
|
** ^The sqlite3_mutex_leave() routine exits a mutex that was
|
|
7976
8023
|
** previously entered by the same thread. The behavior
|
|
@@ -8229,6 +8276,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
|
|
|
8229
8276
|
#define SQLITE_TESTCTRL_ASSERT 12
|
|
8230
8277
|
#define SQLITE_TESTCTRL_ALWAYS 13
|
|
8231
8278
|
#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */
|
|
8279
|
+
#define SQLITE_TESTCTRL_JSON_SELFCHECK 14
|
|
8232
8280
|
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
|
|
8233
8281
|
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
|
|
8234
8282
|
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
|
|
@@ -12687,8 +12735,11 @@ struct Fts5PhraseIter {
|
|
|
12687
12735
|
** created with the "columnsize=0" option.
|
|
12688
12736
|
**
|
|
12689
12737
|
** xColumnText:
|
|
12690
|
-
**
|
|
12691
|
-
**
|
|
12738
|
+
** If parameter iCol is less than zero, or greater than or equal to the
|
|
12739
|
+
** number of columns in the table, SQLITE_RANGE is returned.
|
|
12740
|
+
**
|
|
12741
|
+
** Otherwise, this function attempts to retrieve the text of column iCol of
|
|
12742
|
+
** the current document. If successful, (*pz) is set to point to a buffer
|
|
12692
12743
|
** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
|
|
12693
12744
|
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
|
|
12694
12745
|
** if an error occurs, an SQLite error code is returned and the final values
|
|
@@ -12698,8 +12749,10 @@ struct Fts5PhraseIter {
|
|
|
12698
12749
|
** Returns the number of phrases in the current query expression.
|
|
12699
12750
|
**
|
|
12700
12751
|
** xPhraseSize:
|
|
12701
|
-
**
|
|
12702
|
-
**
|
|
12752
|
+
** If parameter iCol is less than zero, or greater than or equal to the
|
|
12753
|
+
** number of phrases in the current query, as returned by xPhraseCount,
|
|
12754
|
+
** 0 is returned. Otherwise, this function returns the number of tokens in
|
|
12755
|
+
** phrase iPhrase of the query. Phrases are numbered starting from zero.
|
|
12703
12756
|
**
|
|
12704
12757
|
** xInstCount:
|
|
12705
12758
|
** Set *pnInst to the total number of occurrences of all phrases within
|
|
@@ -12715,12 +12768,13 @@ struct Fts5PhraseIter {
|
|
|
12715
12768
|
** Query for the details of phrase match iIdx within the current row.
|
|
12716
12769
|
** Phrase matches are numbered starting from zero, so the iIdx argument
|
|
12717
12770
|
** should be greater than or equal to zero and smaller than the value
|
|
12718
|
-
** output by xInstCount().
|
|
12771
|
+
** output by xInstCount(). If iIdx is less than zero or greater than
|
|
12772
|
+
** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned.
|
|
12719
12773
|
**
|
|
12720
|
-
**
|
|
12774
|
+
** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol
|
|
12721
12775
|
** to the column in which it occurs and *piOff the token offset of the
|
|
12722
|
-
** first token of the phrase.
|
|
12723
|
-
** code (i.e. SQLITE_NOMEM) if an error occurs.
|
|
12776
|
+
** first token of the phrase. SQLITE_OK is returned if successful, or an
|
|
12777
|
+
** error code (i.e. SQLITE_NOMEM) if an error occurs.
|
|
12724
12778
|
**
|
|
12725
12779
|
** This API can be quite slow if used with an FTS5 table created with the
|
|
12726
12780
|
** "detail=none" or "detail=column" option.
|
|
@@ -12746,6 +12800,10 @@ struct Fts5PhraseIter {
|
|
|
12746
12800
|
** Invoking Api.xUserData() returns a copy of the pointer passed as
|
|
12747
12801
|
** the third argument to pUserData.
|
|
12748
12802
|
**
|
|
12803
|
+
** If parameter iPhrase is less than zero, or greater than or equal to
|
|
12804
|
+
** the number of phrases in the query, as returned by xPhraseCount(),
|
|
12805
|
+
** this function returns SQLITE_RANGE.
|
|
12806
|
+
**
|
|
12749
12807
|
** If the callback function returns any value other than SQLITE_OK, the
|
|
12750
12808
|
** query is abandoned and the xQueryPhrase function returns immediately.
|
|
12751
12809
|
** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK.
|
|
@@ -12860,9 +12918,42 @@ struct Fts5PhraseIter {
|
|
|
12860
12918
|
**
|
|
12861
12919
|
** xPhraseNextColumn()
|
|
12862
12920
|
** See xPhraseFirstColumn above.
|
|
12921
|
+
**
|
|
12922
|
+
** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken)
|
|
12923
|
+
** This is used to access token iToken of phrase iPhrase of the current
|
|
12924
|
+
** query. Before returning, output parameter *ppToken is set to point
|
|
12925
|
+
** to a buffer containing the requested token, and *pnToken to the
|
|
12926
|
+
** size of this buffer in bytes.
|
|
12927
|
+
**
|
|
12928
|
+
** If iPhrase or iToken are less than zero, or if iPhrase is greater than
|
|
12929
|
+
** or equal to the number of phrases in the query as reported by
|
|
12930
|
+
** xPhraseCount(), or if iToken is equal to or greater than the number of
|
|
12931
|
+
** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken
|
|
12932
|
+
are both zeroed.
|
|
12933
|
+
**
|
|
12934
|
+
** The output text is not a copy of the query text that specified the
|
|
12935
|
+
** token. It is the output of the tokenizer module. For tokendata=1
|
|
12936
|
+
** tables, this includes any embedded 0x00 and trailing data.
|
|
12937
|
+
**
|
|
12938
|
+
** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken)
|
|
12939
|
+
** This is used to access token iToken of phrase hit iIdx within the
|
|
12940
|
+
** current row. If iIdx is less than zero or greater than or equal to the
|
|
12941
|
+
** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise,
|
|
12942
|
+
** output variable (*ppToken) is set to point to a buffer containing the
|
|
12943
|
+
** matching document token, and (*pnToken) to the size of that buffer in
|
|
12944
|
+
** bytes. This API is not available if the specified token matches a
|
|
12945
|
+
** prefix query term. In that case both output variables are always set
|
|
12946
|
+
** to 0.
|
|
12947
|
+
**
|
|
12948
|
+
** The output text is not a copy of the document text that was tokenized.
|
|
12949
|
+
** It is the output of the tokenizer module. For tokendata=1 tables, this
|
|
12950
|
+
** includes any embedded 0x00 and trailing data.
|
|
12951
|
+
**
|
|
12952
|
+
** This API can be quite slow if used with an FTS5 table created with the
|
|
12953
|
+
** "detail=none" or "detail=column" option.
|
|
12863
12954
|
*/
|
|
12864
12955
|
struct Fts5ExtensionApi {
|
|
12865
|
-
int iVersion; /* Currently always set to
|
|
12956
|
+
int iVersion; /* Currently always set to 3 */
|
|
12866
12957
|
|
|
12867
12958
|
void *(*xUserData)(Fts5Context *);
|
|
12868
12959
|
|
|
@@ -12899,6 +12990,11 @@ struct Fts5ExtensionApi {
|
|
|
12899
12990
|
int (*xPhraseFirstColumn)(Fts5Context *, int iPhrase, Fts5PhraseIter *,
|
|
12900
12991
|
int *);
|
|
12901
12992
|
void (*xPhraseNextColumn)(Fts5Context *, Fts5PhraseIter *, int *piCol);
|
|
12993
|
+
|
|
12994
|
+
/* Below this point are iVersion>=3 only */
|
|
12995
|
+
int (*xQueryToken)(Fts5Context *, int iPhrase, int iToken,
|
|
12996
|
+
const char **ppToken, int *pnToken);
|
|
12997
|
+
int (*xInstToken)(Fts5Context *, int iIdx, int iToken, const char **, int *);
|
|
12902
12998
|
};
|
|
12903
12999
|
|
|
12904
13000
|
/*
|
package/cpp/utils.cpp
CHANGED
|
@@ -210,12 +210,12 @@ BatchResult importSQLFile(std::string dbName, std::string fileLocation) {
|
|
|
210
210
|
try {
|
|
211
211
|
int affectedRows = 0;
|
|
212
212
|
int commands = 0;
|
|
213
|
-
|
|
213
|
+
opsqlite_execute_literal(dbName, "BEGIN EXCLUSIVE TRANSACTION");
|
|
214
214
|
while (std::getline(sqFile, line, '\n')) {
|
|
215
215
|
if (!line.empty()) {
|
|
216
|
-
BridgeResult result =
|
|
216
|
+
BridgeResult result = opsqlite_execute_literal(dbName, line);
|
|
217
217
|
if (result.type == SQLiteError) {
|
|
218
|
-
|
|
218
|
+
opsqlite_execute_literal(dbName, "ROLLBACK");
|
|
219
219
|
sqFile.close();
|
|
220
220
|
return {SQLiteError, result.message, 0, commands};
|
|
221
221
|
} else {
|
|
@@ -225,11 +225,11 @@ BatchResult importSQLFile(std::string dbName, std::string fileLocation) {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
sqFile.close();
|
|
228
|
-
|
|
228
|
+
opsqlite_execute_literal(dbName, "COMMIT");
|
|
229
229
|
return {SQLiteOk, "", affectedRows, commands};
|
|
230
230
|
} catch (...) {
|
|
231
231
|
sqFile.close();
|
|
232
|
-
|
|
232
|
+
opsqlite_execute_literal(dbName, "ROLLBACK");
|
|
233
233
|
return {SQLiteError,
|
|
234
234
|
"[op-sqlite][loadSQLFile] Unexpected error, transaction was "
|
|
235
235
|
"rolledback",
|
package/op-sqlite.podspec
CHANGED
|
@@ -28,6 +28,8 @@ Pod::Spec.new do |s|
|
|
|
28
28
|
|
|
29
29
|
other_cflags = '-DSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION=1'
|
|
30
30
|
|
|
31
|
+
optimizedCflags = other_cflags + '$(inherited) -DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE=1 -DSQLITE_USE_ALLOCA=1'
|
|
32
|
+
|
|
31
33
|
xcconfig = {
|
|
32
34
|
:GCC_PREPROCESSOR_DEFINITIONS => "HAVE_FULLFSYNC=1",
|
|
33
35
|
:WARNING_CFLAGS => "-Wno-shorten-64-to-32 -Wno-comma -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-deprecated-declarations",
|
|
@@ -43,7 +45,12 @@ Pod::Spec.new do |s|
|
|
|
43
45
|
|
|
44
46
|
if ENV['OP_SQLITE_PERF'] == '1' then
|
|
45
47
|
puts "OP-SQLITE performance mode enabled! 🚀\n"
|
|
46
|
-
xcconfig[:OTHER_CFLAGS] =
|
|
48
|
+
xcconfig[:OTHER_CFLAGS] = optimizedCflags + ' -DSQLITE_THREADSAFE=0 '
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
if ENV['OP_SQLITE_PERF'] == '2' then
|
|
52
|
+
puts "OP-SQLITE (thread safe) performance mode enabled! 🚀\n"
|
|
53
|
+
xcconfig[:OTHER_CFLAGS] = optimizedCflags + ' -DSQLITE_THREADSAFE=1 '
|
|
47
54
|
end
|
|
48
55
|
|
|
49
56
|
s.pod_target_xcconfig = xcconfig
|