(** SQL shell backend for SQLite. [Sqlite_shell] runs a {!Sqlite.t} as a {!Sql_shell} backend, running each input statement as the [sqlite3] command line does. A lock serialises statements, so several shell sessions can share one database. *) type t (** The type for databases shared by shell sessions, with their lock. *) val v : ?banner:string -> Sqlite.t -> t (** [v ~banner db] is [db] with a new lock. [banner] is the greeting of an interactive session (defaults to a short SQLite greeting). *) val with_db : t -> (Sqlite.t -> 'a) -> 'a (** [with_db t f] is [f db] with the lock of [t] held, where [db] is the database of [t]. *) module Backend : Sql_shell.BACKEND with type t = t (** The {!Sql_shell.BACKEND} of SQLite databases, for {!Sql_shell.Make}. *) val shell : t -> ?emit_err:(string -> unit) -> ?width:(unit -> int) -> styled:bool -> emit:(string -> unit) -> unit -> Sql_shell.t (** [shell t ~emit_err ~width ~styled ~emit ()] is a new SQL shell on [t] that writes its output with [emit], as {!Sql_shell.Make.v} makes it. [width ()] is the terminal width for result tables. *)