Title: Theory / Unimportant / CS / Programming / Python / Lib / sqlite3
Tags: FromInstruction computer_to_instruction hasNotNewEffectReturnsMeaning some_instruction

Instruction: ON CONFLICT IGNORE
Page: https://sqlite.org/lang_conflict.html
Effect: When an applicable constraint violation occurs, this resolution algorithm skips the one row that contains the constraint violation and continues processing subsequent rows of the SQL statement as if nothing went wrong. Other rows before and after the row that contained the constraint violation are inserted or updated normally. No error is returned when this conflict resolution algorithm is used.
Language: Python

Instruction: ON CONFLICT REPLACE
Page: https://sqlite.org/lang_conflict.html
Effect: When a UNIQUE or PRIMARY KEY constraint violation occurs, this algorithm deletes pre-existing rows that are causing the constraint violation prior to inserting or updating the current row and the command continues executing normally. If a NOT NULL constraint violation occurs, the REPLACE conflict resolution replaces the NULL value with the default value for that column, or if the column has no default value, then the ABORT algorithm is used. If a CHECK constraint violation occurs, the REPLACE conflict resolution algorithm always works like ABORT.
When this conflict resolution strategy deletes rows in order to satisfy a constraint, delete triggers fire if and only if recursive triggers are enabled.
The update hook is not invoked for rows that are deleted by this conflict resolution strategy. Nor does it increment the change counter. The exceptional behaviors defined in this paragraph might change in a future release.
Language: Python

Question: What is the default algorithm in case of conflict in a transaction ?
Answer: ABORT
Page: https://sqlite.org/lang_conflict.html

Instruction: UPDATE bar SET foo
Page: https://sqlite.org/lang_update.html
Effect: Change table bar according to the instructions of foo
Language: Python

Instruction: WHERE foo
Page: https://sqlite.org/lang_update.html
Effect: Restrict the update to lines satisfying foo
Language: Python
Where to use it: UPDATE

Instruction: LIMIT foo
Page: https://sqlite.org/lang_update.html
Effect: Restrict the update to at most foo lines, where foo is casted as an integer. All lines if foo is negative
Language: Python
Where to use it: UPDATE

Instruction: OFFSET foo
Page: https://sqlite.org/lang_update.html
Effect: Does not update the foo first lines
Language: Python
Where to use it: UPDATE limite

Instruction: ORDER BY foo
Page: https://sqlite.org/lang_update.html
Effect: State that the lines should be considered according to the order foo
Language: Python
Where to use it: UPDATE

Instruction: sqlite3.connect(':memory:')
Page: https://docs.python.org/3/library/sqlite3.html
Effect: Create a database in RAM
Language: Python

Instruction: sqlite3.connect(foo)
Page: https://docs.python.org/3/library/sqlite3.html
Effect: Open a sqlite3 database saved in file foo
Language: Python

Instruction: timeout=n
Page: https://docs.python.org/3/library/sqlite3.html
Effect: State that if the database is locked for more than n seconds during a query, an exception should be raised
Language: Python
Context: sqlite3.connect(foo)

Instruction: check_same_thread
Page: https://docs.python.org/3/library/sqlite3.html
Language: Python
Context: sqlite3.connect()
Returns: Whether to accept that another thread write on this connection

Instruction: uri
Page: https://docs.python.org/3/library/sqlite3.html
Language: Python
Context: sqlite3.connect()
Returns: Whether the input should be considered as an uri, with potentially options

Instruction: ON CONFLICT ROLLBACK
Page: https://sqlite.org/lang_conflict.html
Effect: When an applicable constraint violation occurs, this resolution algorithm aborts the current SQL statement with an SQLITE_CONSTRAINT error and rolls back the current transaction. If no transaction is active (other than the implied transaction that is created on every command) then the ROLLBACK resolution algorithm works the same as the ABORT algorithm.
Language: Python

Instruction: ON CONFLICT ABORT
Page: https://sqlite.org/lang_conflict.html
Effect: When an applicable constraint violation occurs, this resolution algorithm aborts the current SQL statement with an SQLITE_CONSTRAINT error and backs out any changes made by the current SQL statement; but changes caused by prior SQL statements within the same transaction are preserved and the transaction remains active.
Language: Sql

Instruction: ON CONFLICT FAIL
Page: https://sqlite.org/lang_conflict.html
Effect: When an applicable constraint violation occurs, this resolution algorithm aborts the current SQL statement with an SQLITE_CONSTRAINT error. But this resolution does not back out prior changes of the SQL statement that failed nor does it end the transaction. For example, if an UPDATE statement encountered a constraint violation on the 100th row that it attempts to update, then the first 99 row changes are preserved but changes to rows 100 and beyond never occur.
Language: Python