The direct answer

Review the declared relationship, effective enforcement on the actual connection and existing-data check coverage as separate evidence. A schema declaration or clean general integrity result does not establish all three, and a valid parent reference still supplies neither workspace authorization nor commit success.

Choose one metadata relationship, not a database permission system

A fictional AI application stores run metadata and the artifacts produced for each run. It needs to associate artifact A-A with run R-A. The application has already authorized that exact association for the current workspace; the database relationship asks a different question: does the stored parent reference satisfy the declared schema?

This worksheet selects one trusted SQLite database D-A and schema revision S-A. Its parent table has one named primary run key. Its child table has a separate artifact identity and one required, non-null run reference of the same declared type. The reference is immediate, with no cascades, triggers, views or attached databases. These are policy labels, not constructed table definitions or SQL.

The fixed application operation inserts only the admitted metadata association. The model chooses no database, column, parent or command. This is separate from row authorization and from deciding whether a database copy completed.

Require an eligible parent and a separate non-null rule

SQLite’s foreign-key documentation describes an existence relationship with a null exception: a null child key need not match a parent. A required reference therefore needs a separate NOT NULL constraint. The parent key must be eligible; this profile selects a named primary key rather than an assumed row identifier.

The application’s non-null field contract rejects missing parent input before dispatch. The independently reviewed schema must also express its required reference. Do not report that the foreign key itself enforces a no-null rule. Likewise, a parent that exists in the wrong workspace can satisfy existence while failing application authorization.

Schema identity matters alongside data. Changing the parent key, nullability or relationship inventory invalidates this sheet; a familiar table name does not preserve the reviewed behavior.

Review effective connection setup instead of relying on defaults

The same reference requires library support and runtime enablement per connection. Its readback distinguishes enabled from disabled state; no returned data is not enabled evidence. The PRAGMA reference says changing foreign_keys is a no-op while a BEGIN or SAVEPOINT is pending. It also warns against depending on compile-time or future defaults.

For proposed connection C-A, require a supported setup boundary without a pending transaction or savepoint, the intended setting and a complete interpreted readback on that same connection. An issued setting request without an error is insufficient evidence. No setup command or query is provided or run here.

C-A belongs exclusively to this attempt from admission through the fixed operation. An earlier connection’s record cannot be borrowed, and an adapter must not quietly replace C-A. Actual library support, transaction state and adapter behavior remain unimplemented prerequisites. Missing evidence holds the operation instead of assuming a driver initialized it correctly.

Keep immediate timing and existing-data coverage independent

SQLite distinguishes immediate and deferred constraints. Immediate violations are checked at statement conclusion, but defer_foreign_keys can override declared timing. The PRAGMA reference documents that override and cautions that turning it off resets tracking. This profile permits no deferral or setting changes during the admitted attempt; it offers no mid-transaction repair by toggling a flag.

The same reference says foreign_key_check reports each violation in its selected database or table scope. In contrast, integrity_check does not find foreign-key errors. A clean general check is therefore not interchangeable with complete foreign-key-specific evidence.

Keep the existing-data disposition separately bound to D-A/S-A and its exact inspection scope. Enabling enforcement is not a report that historical rows were inspected or repaired. Missing completion, an adapter error or unestablished support cannot be relabeled as “zero violations.” No check result was observed here.

Use a useful conditional admission sheet

The original sheet below contains inert associations only:

PROPOSED_UNRUN
Database/schema: D-A / S-A
Connection: C-A / exclusive admitted lifecycle
Setup evidence: E-A / supported enabled readback, admissible boundary
Timing: immediate relationship; no deferral during attempt
Existing-data evidence: F-A / complete declared FK-check scope
New association: artifact A-A refers to existing authorized run R-A
Required next evidence: fixed-operation and transaction outcome

The positive preserves an ordinary metadata task: record a new summary artifact for its already authorized run. It becomes eligible only when the admitted schema, actual connection, setup evidence, stable data scope and current rights all match. Actual support and these lifecycle controls are unknown here, so the sheet authorizes no execution.

Maintaining the association between evidence and use requires a separately supported ownership and coordination design. Exclude concurrent data or schema changes across the relied-upon evidence. An old clean result cannot prove a later state stayed unchanged; this article supplies no locking, pooling or migration implementation.

Walk eight inert decision cards

Original relationship-admission cards; all PROPOSED_UNRUN
ConditionDecision and evidence limit
D-A/S-A/C-A, E-A/F-A, non-null R-A and current rights all matchConditionally admit the fixed insertion plan; report no executed or committed result.
Only the schema declaration is supplied; effective enforcement is off or unknownHold the connection-enforcement claim.
Enablement is attempted inside an active transaction or savepointDo not infer a changed setting from an error-free request.
Build support or complete readback is unavailableHold; neither a library name nor absent output proves enabled enforcement.
Current enforcement is enabled but existing-data evidence is absent or reports violationsWithhold the consistent-data admission claim; perform no automatic repair.
A general integrity result is clean but F-A is missingReject the substituted check coverage.
The proposed reference has no parent, or is null despite the required field contractReject at the applicable relationship or non-null gate; invent no observed database error.
The parent exists but rights fail, or the transaction outcome is unknownWithhold independently or preserve uncertainty; existence supplies no authority or commit proof.

Keep the claim smaller than database integrity

The selected pages are maintained SQLite documentation, not an observed installed release, build or driver. This profile establishes no all-connection integrity, byte-content correctness, external artifact existence, performance ceiling, disclosure protection or physical durability. A metadata parent can exist while its associated file is missing or its contents are unsuitable for model context.

For these proposed cases, no SQL, schema or PRAGMA statement was constructed or executed. No database, connection, transaction, check, import or runtime fixture was opened or exercised. Documentation reads and private editorial file handling are separate.

Boundary is a prelaunch model router with planned request-path checks, not a shipped SQLite integrity or authorization service. Its synthetic action exercise and existing mock evidence provide no database enforcement result.

Primary sources

Official references supporting the guidance. Examples in this guide are synthetic and are not reports of a production incident.

  1. SQLite — Foreign Key Support
  2. SQLite — PRAGMA Statements