From 62123e577ee5d4066d53f8ad7e5ac3d2eb190430 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 18 Nov 2026 20:24:52 +0100 Subject: Securized the queries in the database with a dedicated type for the Identifiers --- lib/common/sql.ml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/common/sql.ml (limited to 'lib/common/sql.ml') diff --git a/lib/common/sql.ml b/lib/common/sql.ml new file mode 100644 index 0000000..1c0e2bb --- /dev/null +++ b/lib/common/sql.ml @@ -0,0 +1,8 @@ +(** Helper to embed an SQL string literal into a query string. + + Identifiers are not handled here: they have the abstract type + [Model.Identifier.t], whose only constructor validates the string, and are + quoted with [Model.Identifier.quote]. *) + +let quote_literal : string -> string = + fun s -> "'" ^ String.concat "''" (String.split_on_char '\'' s) ^ "'" -- cgit v1.2.3