Something went wrong. Try again.
SQL frontend over the catalog engine
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738(*--------------------------------------------------------------------------- Copyright (c) 2026 Thomas Gazagnaire. All rights reserved. SPDX-License-Identifier: ISC ---------------------------------------------------------------------------*)
(** The schema table, [sqlite_master], read over any catalog from the definitions its store keeps ({!Catalog.Spi.definitions}) (schematab.html).*)
val columns : string list(** [columns] is the schema table's columns: [type], {!val-name}, [tbl_name], [rootpage] and [sql]. *)
val is_name : string -> bool(** [is_name name] is [true] iff [name] names a schema table: [sqlite_master] or [sqlite_schema], or the temp database's, [sqlite_temp_master] or [sqlite_temp_schema]. *)
val name : string -> string(** [name n] is the name sqlite3 gives the schema table [n] names, which a refusal names it by: [sqlite_temp_master] for the temp one, [sqlite_master] otherwise. *)
val over : Catalog.t -> Query.catalog -> Query.catalog(** [over cat q] is [q] reading the schema tables of [cat] too. The main one has a row per definition of [cat] under its rowid, in rowid order: its kind as [type], its name, its table, a [rootpage] of [0], as for any object sqlite3 keeps no b-tree for, and its text, or NULL for the index a constraint makes. The temp one has no row. Neither has an index, an affinity or a collating sequence. *)
val check_drop : Ast.drop -> unit(** [check_drop d] refuses a [DROP TABLE] or a [DROP VIEW] of a schema table of [main] or [temp], as sqlite3 refuses it whatever [IF EXISTS] says.
@raise Catalog.Error ["table sqlite_master may not be dropped"], or [sqlite_temp_master]'s. *)