气势凌人的眼镜 · wc コマンド for windows ...· 9 月前 · |
伤情的领带 · linux的wc -l ...· 11 月前 · |
微笑的企鹅 · SQLiteDatabase - WCDB ...· 1 年前 · |
谦逊的茴香 · My Project: ...· 1 年前 · |
微醺的牛肉面 · 1496905 – wc -l gives ...· 1 年前 · |
自信的热水瓶 · 两个json字符串合成一个 - CSDN文库· 1 月前 · |
坚强的碗 · Cannot insert the ...· 2 月前 · |
精明的荔枝 · 中铁银通卡怎么报销车票?_深圳之窗· 6 月前 · |
腼腆的伤疤 · 分区表-理论 - JustJavaIt - 博客园· 9 月前 · |
含蓄的大象 · 从 express 到 midway | ...· 10 月前 · |
string wc |
https://tencent.github.io/wcdb/references/android/reference/com/tencent/wcdb/database/SQLiteDatabase.html |
微笑的企鹅
1 年前 |
BINARY
collator, Android supplies
two more,
LOCALIZED
, which changes with the system's current locale,
and
UNICODE
, which is the Unicode Collation Algorithm and not tailored
to the current locale.
CONFLICT_ABORT
When a constraint violation occurs,no ROLLBACK is executed
so changes from prior commands within the same transaction
are preserved.
CONFLICT_REPLACE
When a UNIQUE constraint violation occurs, the pre-existing rows that
are causing the constraint violation are removed prior to inserting
or updating the current row.
CONFLICT_ROLLBACK
When a constraint violation occurs, an immediate ROLLBACK occurs,
thus ending the current transaction, and the command aborts with a
return code of SQLITE_CONSTRAINT.
CREATE_IF_NECESSARY
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to create the database file if it does not
already exist.
ENABLE_WRITE_AHEAD_LOGGING
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database file with
write-ahead logging enabled by default.
NO_CORRUPTION_BACKUP
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
that indicates no backup for database files is
done when corruption is detected.
NO_LOCALIZED_COLLATORS
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database without support for
localized collators.
OPEN_READWRITE
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database for reading and writing.
If the disk is full, this may fail even before you actually write anything.
SQLITE_MAX_LIKE_PATTERN_LENGTH
Maximum Length Of A LIKE Or GLOB Pattern
The pattern matching algorithm used in the default LIKE and GLOB implementation
of SQLite can exhibit O(N^2) performance (where N is the number of characters in
the pattern) for certain pathological cases.
beginTransactionWithListenerNonExclusive
(
SQLiteTransactionListener
transactionListener)
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
Cursor
over the result set.
Cursor
over the result set.
Cursor
over the result set.
Cursor
over the result set.
Cursor
over the result set.
Cursor
over the result set.
When a constraint violation occurs,no ROLLBACK is executed so changes from prior commands within the same transaction are preserved. This is the default behavior.
When a constraint violation occurs, the command aborts with a return code SQLITE_CONSTRAINT. But any changes to the database that the command made prior to encountering the constraint violation are preserved and are not backed out.
When a constraint violation occurs, the one row that contains the constraint violation is not inserted or changed. But the command continues executing normally. Other rows before and after the row that contained the constraint violation continue to be inserted or updated normally. No error is returned.
When a UNIQUE constraint violation occurs, the pre-existing rows that are causing the constraint violation are removed prior to inserting or updating the current row. Thus the insert or update always occurs. The command continues executing normally. No error is returned. If a NOT NULL constraint violation occurs, the NULL value is replaced by the default value for that column. If the column has no default value, then the ABORT algorithm is used. If a CHECK constraint violation occurs then the IGNORE algorithm is used. When this conflict resolution strategy deletes rows in order to satisfy a constraint, it does not invoke delete triggers on those rows. This behavior might change in a future release.
When a constraint violation occurs, an immediate ROLLBACK occurs, thus ending the current transaction, and the command aborts with a return code of SQLITE_CONSTRAINT. If no transaction is active (other than the implied transaction that is created on every command) then this algorithm works the same as ABORT.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to create the database file if it does not
already exist.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database with I/O trace enabled.
This causes database to log I/O operations to file.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database file with
write-ahead logging enabled by default. Using this flag is more efficient
than calling
enableWriteAheadLogging()
.
Write-ahead logging cannot be used with read-only databases so the value of
this flag is ignored if the database is opened read-only.
enableWriteAheadLogging()
Absolute max value that can be set by
setMaxSqlCacheSize(int)
.
Each prepared-statement is between 1K - 6K, depending on the complexity of the
SQL statement & schema. A large SQL cache may use a significant amount of memory.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
that indicates no backup for database files is
done when corruption is detected.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database without support for
localized collators.
This causes the collator
LOCALIZED
not to be created.
You must be consistent when using this flag to use the setting the database was
created with. If this is set,
setLocale(Locale)
will do nothing.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database for reading only.
This is the only reliable way to open a database if the disk may be full.
Open flag: Flag for
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
to open the database for reading and writing.
If the disk is full, this may fail even before you actually write anything.
Note that the value of this flag is 0, so it is the default.
Maximum Length Of A LIKE Or GLOB Pattern The pattern matching algorithm used in the default LIKE and GLOB implementation of SQLite can exhibit O(N^2) performance (where N is the number of characters in the pattern) for certain pathological cases. To avoid denial-of-service attacks the length of the LIKE or GLOB pattern is limited to SQLITE_MAX_LIKE_PATTERN_LENGTH bytes. The default value of this limit is 50000. A modern workstation can evaluate even a pathological LIKE or GLOB pattern of 50000 bytes relatively quickly. The denial of service problem only comes into play when the pattern length gets into millions of bytes. Nevertheless, since most useful LIKE or GLOB patterns are at most a few dozen bytes in length, paranoid application developers may want to reduce this parameter to something in the range of a few hundred if they know that external users are able to generate arbitrary patterns. Transactions can be nested. When the outer transaction is ended all of the work done in that transaction and all of the nested transactions will be committed or rolled back. The changes will be rolled back if any transaction is ended without being marked as clean (by calling setTransactionSuccessful). Otherwise they will be committed.
Here is the standard idiom for transactions: db.beginTransaction(); try { db.setTransactionSuccessful(); } finally { db.endTransaction();
Begins a transaction in IMMEDIATE mode. Transactions can be nested. When the outer transaction is ended all of the work done in that transaction and all of the nested transactions will be committed or rolled back. The changes will be rolled back if any transaction is ended without being marked as clean (by calling setTransactionSuccessful). Otherwise they will be committed. Here is the standard idiom for transactions: db.beginTransactionNonExclusive(); try { db.setTransactionSuccessful(); } finally { db.endTransaction(); Transactions can be nested. When the outer transaction is ended all of the work done in that transaction and all of the nested transactions will be committed or rolled back. The changes will be rolled back if any transaction is ended without being marked as clean (by calling setTransactionSuccessful). Otherwise they will be committed.
Here is the standard idiom for transactions: db.beginTransactionWithListener(listener); try { db.setTransactionSuccessful(); } finally { db.endTransaction();
yieldIfContendedSafely()
.
Begins a transaction in IMMEDIATE mode. Transactions can be nested. When the outer transaction is ended all of the work done in that transaction and all of the nested transactions will be committed or rolled back. The changes will be rolled back if any transaction is ended without being marked as clean (by calling setTransactionSuccessful). Otherwise they will be committed. Here is the standard idiom for transactions: db.beginTransactionWithListenerNonExclusive(listener); try { db.setTransactionSuccessful(); } finally { db.endTransaction();
yieldIfContendedSafely()
.
Compiles an SQL statement into a reusable pre-compiled statement object.
The parameters are identical to
execSQL(String)
. You may put ?s in the
statement and fill in those values with
bindString(int, String)
and
bindLong(int, long)
each time you want to run the
statement. Statements may not return result sets larger than 1x1.
No two threads should be using the same
SQLiteStatement
at the same time.
Create a memory backed SQLite database. Its contents will be destroyed when the database is closed.
Sets the locale of the database to the the system's current locale.
Call
setLocale(Locale)
if you would like something else.
Deletes a database including its journal file and other auxiliary files that may have been created by the database engine.
This method enables parallel execution of queries from multiple threads on the
same database. It does this by opening multiple connections to the database
and using a different database connection for each query. The database
journal mode is also changed to enable writes to proceed concurrently with reads.
When write-ahead logging is not enabled (the default), it is not possible for
reads and writes to occur on the database at the same time. Before modifying the
database, the writer implicitly acquires an exclusive lock on the database which
prevents readers from accessing the database until the write is completed.
In contrast, when write-ahead logging is enabled (by calling this method), write
operations occur in a separate log file which allows reads to proceed concurrently.
While a write is in progress, readers on other threads will perceive the state
of the database as it was before the write began. When the write completes, readers
on other threads will then perceive the new state of the database.
It is a good idea to enable write-ahead logging whenever a database will be
concurrently accessed and modified by multiple threads at the same time.
However, write-ahead logging uses significantly more memory than ordinary
journaling because there are multiple connections to the same database.
So if a database will only be used by a single thread, or if optimizing
concurrency is not very important, then write-ahead logging should be disabled.
After calling this method, execution of queries in parallel is enabled as long as
the database remains open. To disable execution of queries in parallel, either
call
disableWriteAheadLogging()
or close the database and reopen it.
The maximum number of connections used to execute queries in parallel is
dependent upon the device memory and possibly other properties.
If a query is part of a transaction, then it is executed on the same database handle the
transaction was begun.
Writers should use
beginTransactionNonExclusive()
or
beginTransactionWithListenerNonExclusive(SQLiteTransactionListener)
to start a transaction. Non-exclusive mode allows database file to be in readable
by other threads executing queries.
If the database has any attached databases, then execution of queries in parallel is NOT
possible. Likewise, write-ahead logging is not supported for read-only databases
or memory databases. In such cases,
enableWriteAheadLogging()
returns false.
The best way to enable write-ahead logging is to pass the
ENABLE_WRITE_AHEAD_LOGGING
flag to
openDatabase(String, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, int, DatabaseErrorHandler)
. This is
more efficient than calling
enableWriteAheadLogging()
.
SQLiteDatabase db = SQLiteDatabase.openDatabase("db_filename", cursorFactory,
SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING,
myDatabaseErrorHandler);
db.enableWriteAheadLogging();
Another way to enable write-ahead logging is to call
enableWriteAheadLogging()
after opening the database.
SQLiteDatabase db = SQLiteDatabase.openDatabase("db_filename", cursorFactory,
SQLiteDatabase.CREATE_IF_NECESSARY, myDatabaseErrorHandler);
db.enableWriteAheadLogging();
See also
SQLite Write-Ahead Logging
for
more details about how write-ahead logging works.
End a transaction. See beginTransaction for notes about how to use this and when transactions are committed and rolled back.
Execute a single SQL statement that is NOT a SELECT
or any other SQL statement that returns data.
It has no means to return any data (such as the number of affected rows).
Instead, you're encouraged to use
insert(String, String, ContentValues)
,
update(String, ContentValues, String, String[])
, et al, when possible.
When using
enableWriteAheadLogging()
, journal_mode is
automatically managed by this class. So, do not set journal_mode
using "PRAGMA journal_mode'
enableWriteAheadLogging()
Execute a single SQL statement that is NOT a SELECT/INSERT/UPDATE/DELETE. For INSERT statements, use any of the following instead.
insert(String, String, ContentValues)
insertOrThrow(String, String, ContentValues)
insertWithOnConflict(String, String, ContentValues, int)
update(String, ContentValues, String, String[])
updateWithOnConflict(String, ContentValues, String, String[], int)
delete(String, String, String[])
enableWriteAheadLogging()
, journal_mode is
automatically managed by this class. So, do not set journal_mode
using "PRAGMA journal_mode'
enableWriteAheadLogging()
Returns list of full pathnames of all attached databases including the main database by executing 'pragma database_list' on the database.
Deprecated.
null
.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your provided
values
is
empty, no column names are known and an empty row can't be inserted.
If not set to null, the
nullColumnHack
parameter
provides the name of nullable column name to explicitly insert a NULL into
in the case where your
values
is empty.
values
this map contains the initial column values for the
row. The keys should be the column names and the values the
column values
nullColumnHack
optional; may be
null
.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your provided
values
is
empty, no column names are known and an empty row can't be inserted.
If not set to null, the
nullColumnHack
parameter
provides the name of nullable column name to explicitly insert a NULL into
in the case where your
values
is empty.
values
this map contains the initial column values for the
row. The keys should be the column names and the values the
column values
nullColumnHack
optional; may be
null
.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your provided
initialValues
is
empty, no column names are known and an empty row can't be inserted.
If not set to null, the
nullColumnHack
parameter
provides the name of nullable column name to explicitly insert a NULL into
in the case where your
initialValues
is empty.
initialValues
this map contains the initial column values for the
row. The keys should be the column names and the values the
column values
conflictAlgorithm
for insert conflict resolver
CONFLICT_IGNORE
OR -1 if any error
Runs 'pragma integrity_check' on the given database (and all the attached databases) and returns true if the given database (and all its attached databases) pass integrity_check, false otherwise. If the result is false, then this method logs the errors reported by the integrity_check command execution. Note that 'pragma integrity_check' on a database can take a long time.
Returns true if the current thread is holding an active connection to the database. The name of this method comes from a time when having an active connection to the database meant that the thread was holding an actual lock on the database. Nowadays, there is no longer a true "database lock" although threads may block if they cannot acquire a database connection to perform a particular operation.
Always returns false. There is no longer the concept of a database lock, so this method always returns false.
Mark this table as syncable. When an update occurs in this table the _sync_dirty field will be set to ensure proper syncing operation.
Mark this table as syncable, with the _sync_dirty residing in another table. When an update occurs in this table the _sync_dirty field of the row in updateTable with the _id in foreignKey will be set to ensure proper syncing operation.
Returns true if the new version code is greater than the current database version.
Open the database according to the flags
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
Sets the locale of the database to the the system's current locale.
Call
setLocale(Locale)
if you would like something else.
Accepts input param: a concrete instance of
DatabaseErrorHandler
to be
used to handle corruption when sqlite reports database corruption.
DatabaseErrorHandler
obj to be used to handle corruption
when sqlite reports database corruption
Open the database according to the flags
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
Sets the locale of the database to the the system's current locale.
Call
setLocale(Locale)
if you would like something else.
Accepts input param: a concrete instance of
DatabaseErrorHandler
to be
used to handle corruption when sqlite reports database corruption.
DatabaseErrorHandler
obj to be used to handle corruption
when sqlite reports database corruption
poolSize
size of the connection pool to the database, 0 for default size
Open the database according to the flags
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
Sets the locale of the database to the the system's current locale.
Call
setLocale(Locale)
if you would like something else.
Accepts input param: a concrete instance of
DatabaseErrorHandler
to be
used to handle corruption when sqlite reports database corruption.
DatabaseErrorHandler
obj to be used to handle corruption
when sqlite reports database corruption
poolSize
size of the connection pool to the database, 0 for default size
Open the database according to the flags
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
Sets the locale of the database to the the system's current locale.
Call
setLocale(Locale)
if you would like something else.
Accepts input param: a concrete instance of
DatabaseErrorHandler
to be
used to handle corruption when sqlite reports database corruption.
DatabaseErrorHandler
obj to be used to handle corruption
when sqlite reports database corruption
Open the database according to the flags
OPEN_READWRITE
OPEN_READONLY
CREATE_IF_NECESSARY
and/or
NO_LOCALIZED_COLLATORS
.
Sets the locale of the database to the the system's current locale.
Call
setLocale(Locale)
if you would like something else.
Cursor
object, which is positioned before the first entry. Note that
Cursor
s are not synchronized, see the documentation for more details.
Cursor
OperationCanceledException
will be thrown
when the query is executed.
Cursor
object, which is positioned before the first entry. Note that
Cursor
s are not synchronized, see the documentation for more details.
Cursor
Cursor
object, which is positioned before the first entry. Note that
Cursor
s are not synchronized, see the documentation for more details.
Cursor
Cursor
object, which is positioned before the first entry. Note that
Cursor
s are not synchronized, see the documentation for more details.
Cursor
Cursor
object, which is positioned before the first entry. Note that
Cursor
s are not synchronized, see the documentation for more details.
Cursor
OperationCanceledException
will be thrown
when the query is executed.
Cursor
object, which is positioned before the first entry. Note that
Cursor
s are not synchronized, see the documentation for more details.
Cursor
OperationCanceledException
will be thrown
when the query is executed.
selectionArgs
You may include ?s in where clause in the query,
which will be replaced by the values from selectionArgs. The
values will be bound as Strings.
selectionArgs
You may include ?s in where clause in the query,
which will be replaced by the values from selectionArgs. The
values will be bound as Strings.
editTable
the name of the first table, which is editable
cancellationSignal
A signal to cancel the operation in progress, or null if none.
If the operation is canceled, then
OperationCanceledException
will be thrown
when the query is executed.
selectionArgs
You may include ?s in where clause in the query,
which will be replaced by the values from selectionArgs. The
values will be bound as Strings.
editTable
the name of the first table, which is editable
Attempts to release memory that SQLite holds but does not require to operate properly. Typically this memory will come from the page cache.
null
.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your provided
initialValues
is
empty, no column names are known and an empty row can't be inserted.
If not set to null, the
nullColumnHack
parameter
provides the name of nullable column name to explicitly insert a NULL into
in the case where your
initialValues
is empty.
initialValues
this map contains the initial column values for
the row.
nullColumnHack
optional; may be
null
.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your provided
initialValues
is
empty, no column names are known and an empty row can't be inserted.
If not set to null, the
nullColumnHack
parameter
provides the name of nullable column name to explicitly insert a NULL into
in the case where your
initialValues
is empty.
initialValues
this map contains the initial column values for
the row. The key
Sets whether foreign key constraints are enabled for the database.
By default, foreign key constraints are not enforced by the database.
This method allows an application to enable foreign key constraints.
It must be called each time the database is opened to ensure that foreign
key constraints are enabled for the session.
A good time to call this method is right after calling
openOrCreateDatabase(File, byte[], SQLiteCipherSpec, SQLiteDatabase.CursorFactory, DatabaseErrorHandler)
or in the
onConfigure(SQLiteDatabase)
callback.
When foreign key constraints are disabled, the database does not check whether
changes to the database will violate foreign key constraints. Likewise, when
foreign key constraints are disabled, the database will not execute cascade
delete or update triggers. As a result, it is possible for the database
state to become inconsistent. To perform a database integrity check,
call
isDatabaseIntegrityOk()
.
This method must not be called while a transaction is in progress.
See also
SQLite Foreign Key Constraints
for more details about foreign key constraint support.
Sets the locale for this database. Does nothing if this database has
the
NO_LOCALIZED_COLLATORS
flag set or was opened read only.
Control whether or not the SQLiteDatabase is made thread-safe by using locks around critical sections. This is pretty expensive, so if you know that your DB will only be used by a single thread then you should set this to false. The default is true.
Sets the maximum size of the prepared-statement cache for this database. (size of the cache = number of compiled-sql-statements stored in the cache). Maximum cache size can ONLY be increased from its current size (default = 10). If this method is called with smaller size than the current maximum value, then IllegalStateException is thrown. This method is thread-safe.
MAX_SQL_CACHE_SIZE
)
Sets the maximum size the database will grow to. The maximum size cannot be set below the current size.
Sets the database page size. The page size must be a power of two. This method does not work if any data has been written to the database file, and must be called right after the database has been created.
Marks the current transaction as successful. Do not do any more database work between calling this and calling endTransaction. Do as little non-database work as possible in that situation too. If any errors are encountered between this and endTransaction the transaction will still be committed.
Temporarily end the transaction to let other threads run. The transaction is assumed to be successful so far. Do not call setTransactionSuccessful before calling this. When this returns a new transaction will have been created but not marked as successful.
Temporarily end the transaction to let other threads run. The transaction is assumed to be successful so far. Do not call setTransactionSuccessful before calling this. When this returns a new transaction will have been created but not marked as successful. This assumes that there are no nested transactions (beginTransaction has only been called once) and will throw an exception if that is not the case.
Temporarily end the transaction to let other threads run. The transaction is assumed to be successful so far. Do not call setTransactionSuccessful before calling this. When this returns a new transaction will have been created but not marked as successful. This assumes that there are no nested transactions (beginTransaction has only been called once) and will throw an exception if that is not the case.
微醺的牛肉面 · 1496905 – wc -l gives wrong line count for files with windows line breaks and single trailing CRNL 1 年前 |
自信的热水瓶 · 两个json字符串合成一个 - CSDN文库 1 月前 |
坚强的碗 · Cannot insert the value NULL into column and column does not allow nulls - Microsoft Q&A 2 月前 |
精明的荔枝 · 中铁银通卡怎么报销车票?_深圳之窗 6 月前 |
腼腆的伤疤 · 分区表-理论 - JustJavaIt - 博客园 9 月前 |
含蓄的大象 · 从 express 到 midway | 敖武的博客 10 月前 |