Skip to content

optional wrapping for queries from one file #56

Description

@cyberhuman

When invoking sqlgg file1.sql file2.sql ... fileN.sql, it would be nice to have every file's queries wrapped in a module:

module Sqlgg (T : Sqlgg_traits.M) = struct

module File1 = struct
  let get_by_id db ~id =
    let get_row stmt =
      (T.get_column_Int stmt 0), (T.get_column_Text stmt 1), (T.get_column_Text stmt 2), (T.get_column_Text stmt 3)
    in
    ...
end
...
module FileN = struct
  let get_by_id db ~id =
    let get_row stmt =
      (T.get_column_Int stmt 0), (T.get_column_Text stmt 1), (T.get_column_Text stmt 2), (T.get_column_Text stmt 3)
    in
    ...
end

end

Also, if all DDL (CREATE TABLE etc) were not wrapped and put on the very top of the module, it would be possible to use a single table declaration from many files, provided they are fed to sqlgg togethere.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions