Skip to content

code_notebook_cell

Description

Each Notebook is divided into cells, which are individual units of interpretable code. The content of Cells depends on the Notebook Kernel and contain the source code to be executed by the Notebook’s Kernel. The output of the code (text, graphics, etc.) can be stateless or may be stateful and store its results and state transitions in code_notebook_state.

Table Definition
CREATE TABLE "code_notebook_cell" (
"code_notebook_cell_id" VARCHAR PRIMARY KEY NOT NULL,
"notebook_kernel_id" VARCHAR NOT NULL,
"notebook_name" TEXT NOT NULL,
"cell_name" TEXT NOT NULL,
"cell_governance" TEXT CHECK(json_valid(cell_governance) OR cell_governance IS NULL),
"interpretable_code" TEXT NOT NULL,
"interpretable_code_hash" TEXT NOT NULL,
"description" TEXT,
"arguments" TEXT CHECK(json_valid(arguments) OR arguments IS NULL),
"created_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"created_by" TEXT DEFAULT 'UNKNOWN',
"updated_at" TIMESTAMP,
"updated_by" TEXT,
"deleted_at" TIMESTAMP,
"deleted_by" TEXT,
"activity_log" TEXT,
FOREIGN KEY("notebook_kernel_id") REFERENCES "code_notebook_kernel"("code_notebook_kernel_id"),
UNIQUE("notebook_name", "cell_name", "interpretable_code_hash")
)

Columns

NameTypeDefaultNullableChildrenParentsComment
code_notebook_cell_idVARCHARfalsecode_notebook_statecode_notebook_cell primary key
notebook_kernel_idVARCHARfalsecode_notebook_kernel{“isSqlDomainZodDescrMeta”:true ,“isVarChar”:true }
notebook_nameTEXTfalse
cell_nameTEXTfalse
cell_governanceTEXTtrueany idempotency, versioning, hash, branch, tag or other “governance” data (dependent on the cell)
interpretable_codeTEXTfalse
interpretable_code_hashTEXTfalse
descriptionTEXTtrue
argumentsTEXTtrue{“isSqlDomainZodDescrMeta”:true ,“isJsonText”:true }
created_atTIMESTAMPCURRENT_TIMESTAMPtrue
created_byTEXT’UNKNOWN’true
updated_atTIMESTAMPtrue
updated_byTEXTtrue
deleted_atTIMESTAMPtrue
deleted_byTEXTtrue
activity_logTEXTtrue{“isSqlDomainZodDescrMeta”:true ,“isJsonSqlDomain”:true }

Constraints

NameTypeDefinition
code_notebook_cell_idPRIMARY KEYPRIMARY KEY (code_notebook_cell_id)
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (notebook_kernel_id) REFERENCES code_notebook_kernel (code_notebook_kernel_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
sqlite_autoindex_code_notebook_cell_2UNIQUEUNIQUE (notebook_name, cell_name, interpretable_code_hash)
sqlite_autoindex_code_notebook_cell_1PRIMARY KEYPRIMARY KEY (code_notebook_cell_id)
-CHECKCHECK(json_valid(cell_governance) OR cell_governance IS NULL)
-CHECKCHECK(json_valid(arguments) OR arguments IS NULL)

Indexes

NameDefinition
sqlite_autoindex_code_notebook_cell_2UNIQUE (notebook_name, cell_name, interpretable_code_hash)
sqlite_autoindex_code_notebook_cell_1PRIMARY KEY (code_notebook_cell_id)

Relations

er