hssqlppp icon indicating copy to clipboard operation
hssqlppp copied to clipboard

Constructing catalogs

Open jkarni opened this issue 9 years ago • 6 comments

In version 0.4, one could construct a Catalog with emptyCatalog or defaultCatalog, and a list of catalog updates. In 0.6, emptyCatalog/defaultCatalog seem to be gone, so it's unclear how to construct a catalog.

jkarni avatar Nov 22 '16 14:11 jkarni

For what it's worth, emptyCatalog is still defined, but not exported.

jkarni avatar Nov 22 '16 14:11 jkarni

I revised the dialect handling and there is no sensible way to start with an empty or 'default' catalog. Can you do the same thing starting with the ansi dialect catalog? If you can explain what you are doing in more detail I can help figure out how to do it or what deficiency in hssqlppp there is. The new dialect approach is a WIP.

JakeWheat avatar Dec 03 '16 13:12 JakeWheat

I've been building a library (see this and this to get a sense for what it will look like) on top of hssqlppp (which, by the way, is a wonderful and herculean enterprise - thanks for it!) that infers haskell types for queries and parameters. It will only support postgres for now, so I wanted to make sure the catalog updates are valid for postgres. ANSI catalog would suffice, but as far as I can tell, that's not exported either (nor is there a way to transform a dialect to catalog).

jkarni avatar Dec 04 '16 20:12 jkarni

Can you use something like 'diDefaultCatalog postgresDialect' to get the catalog?

JakeWheat avatar Dec 05 '16 07:12 JakeWheat

Ha, sorry, that should have been obvious. Thanks!

jkarni avatar Dec 06 '16 17:12 jkarni

I want to leave this bug open because I want to try to improve the documentation to make sure there is a guide about this and some examples.

JakeWheat avatar Dec 07 '16 09:12 JakeWheat