I have a table with a primary key that is of type VARCHAR and is referenced by another table, but it looks like Sequoia only supports. At least, when I try to compile I get this:
Error: This expression has type
string Alias.Field.t = (Alias.Field.table, string) Sequoia_field.t
but an expression was expected of type
(Alias.Field.table, int) Sequoia_mysql.M.Field.t =
(Alias.Field.table, int) Sequoia_field.t
Type string is not compatible with type int
Example:
open Sequoia_mysql
module URL = struct
include (val table "url")
let id = Field.int "id"
(* ... *)
end
module Alias = struct
include (val table "alias")
let name = Field.string "name"
let url = Field.foreign_key "url" ~references:URL.id
(* ... *)
end
module Use = struct
include (val table "use")
let id = Field.int "id"
let alias = Field.foreign_key "alias" ~references:Alias.name (* <- error *)
let url = Field.foreign_key "url" ~references:URL.id
(* ... *)
end
I have a table with a primary key that is of type
VARCHARand is referenced by another table, but it looks like Sequoia only supports. At least, when I try to compile I get this:Example: