Open 64pcyk opened 4 years ago
I'll add only that I tried also:
...
defineTable1 :: [(String, TypeQ)] -> String -> String -> [Name] -> Q [Dec]
defineTable1 tmap = defineTableFromDB connectDatabase (driverPostgreSQL { typeMap = tmap })
...
-- in another module
...
$(defineTable1
[
("real", [t|Double|]),
("float", [t|Double|]),
("double", [t|Double|])
]
"public" "countrylanguage"
[''Show, ''Generic])
...
but errors are the same (about missing instances for type Float).
Hello, Kei-san! I am trying to use Haskell-Relational-Record with PostgreSQL 12 (
psql (12.1 (Debian 12.1-1.pgdg100+1))
) and when I defined a table containing simple types (text
,integer
) - withdefineTableFromDB
- it's OK. But when I try to do the same for table with SQL typereal
then I get an error:This is the code which describes the table:
The table "countrylanguage" is a table from the famous database "world" for PostgreSQL, which looks like:
and a specially the table "countrylanguage" looks like:
Is it an error? Or I miss something? How to fix it? I found some examples with the type "Float" for SQLite3, but why it does not work for PostgreSQL, I have not idea.
PS. Very similar code works fine for table "city" which does not contain columns of "real" type.