Home › Packages › sleela-sql

Package sleela-sql

This package contains 1 source unit(s) defining 3 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

SqlModel #sleela 2.5 (lib/sleela-sql/SqlModel.sleela)

Schema struct

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
nameString nametable name
colsString cols"id, title, year" (display only)
ncolsint ncolscolumn count

Plan struct

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
opString op"CREATE" | "INSERT" | "SELECT"
tableString tabletarget table
nvaluesint nvaluesINSERT: number of VALUES supplied
colString colSELECT: a projected / WHERE column ("" or "*" = all)
colFoundint colFoundSELECT: 1 if `col` exists in the schema, else 0
existsint existsCREATE: 1 if a table of this name already exists

SqlModel class

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkCreatevoid checkCreate(Plan p)Verdict for a CREATE plan (table must not already exist).
checkInsertvoid checkInsert(Plan p, Schema s)Verdict for an INSERT plan against a schema (arity invariant).
checkSelectvoid checkSelect(Plan p, Schema s)Verdict for a SELECT plan against a schema (column existence).
schemaSchema schema(String name, String cols, int ncols)No description in source.
planPlan plan(String op, String table, int nvalues, String col,No description in source.
mainvoid main()No description in source.