on dev help sign in
db ~> schemas
aef1c84Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+56−56
@@ -1651,125 +1651,125 @@ typeview
1651typeview = UnsafeTypeExpression . renderQualifiedAlias
1651typeview = UnsafeTypeExpression . renderQualifiedAlias
1652
1652
1653-- | logical Boolean (true/false)
1653-- | logical Boolean (true/false)
1654−bool :: TypeExpression db (nullity 'PGbool)
1654+bool :: TypeExpression schemas (nullity 'PGbool)
1655bool = UnsafeTypeExpression "bool"
1655bool = UnsafeTypeExpression "bool"
1656-- | signed two-byte integer
1656-- | signed two-byte integer
1657−int2, smallint :: TypeExpression db (nullity 'PGint2)
1657+int2, smallint :: TypeExpression schemas (nullity 'PGint2)
1658int2 = UnsafeTypeExpression "int2"
1658int2 = UnsafeTypeExpression "int2"
1659smallint = UnsafeTypeExpression "smallint"
1659smallint = UnsafeTypeExpression "smallint"
1660-- | signed four-byte integer
1660-- | signed four-byte integer
1661−int4, int, integer :: TypeExpression db (nullity 'PGint4)
1661+int4, int, integer :: TypeExpression schemas (nullity 'PGint4)
1662int4 = UnsafeTypeExpression "int4"
1662int4 = UnsafeTypeExpression "int4"
1663int = UnsafeTypeExpression "int"
1663int = UnsafeTypeExpression "int"
1664integer = UnsafeTypeExpression "integer"
1664integer = UnsafeTypeExpression "integer"
1665-- | signed eight-byte integer
1665-- | signed eight-byte integer
1666−int8, bigint :: TypeExpression db (nullity 'PGint8)
1666+int8, bigint :: TypeExpression schemas (nullity 'PGint8)
1667int8 = UnsafeTypeExpression "int8"
1667int8 = UnsafeTypeExpression "int8"
1668bigint = UnsafeTypeExpression "bigint"
1668bigint = UnsafeTypeExpression "bigint"
1669-- | arbitrary precision numeric type
1669-- | arbitrary precision numeric type
1670−numeric :: TypeExpression db (nullity 'PGnumeric)
1670+numeric :: TypeExpression schemas (nullity 'PGnumeric)
1671numeric = UnsafeTypeExpression "numeric"
1671numeric = UnsafeTypeExpression "numeric"
1672-- | single precision floating-point number (4 bytes)
1672-- | single precision floating-point number (4 bytes)
1673−float4, real :: TypeExpression db (nullity 'PGfloat4)
1673+float4, real :: TypeExpression schemas (nullity 'PGfloat4)
1674float4 = UnsafeTypeExpression "float4"
1674float4 = UnsafeTypeExpression "float4"
1675real = UnsafeTypeExpression "real"
1675real = UnsafeTypeExpression "real"
1676-- | double precision floating-point number (8 bytes)
1676-- | double precision floating-point number (8 bytes)
1677−float8, doublePrecision :: TypeExpression db (nullity 'PGfloat8)
1677+float8, doublePrecision :: TypeExpression schemas (nullity 'PGfloat8)
1678float8 = UnsafeTypeExpression "float8"
1678float8 = UnsafeTypeExpression "float8"
1679doublePrecision = UnsafeTypeExpression "double precision"
1679doublePrecision = UnsafeTypeExpression "double precision"
1680-- | variable-length character string
1680-- | variable-length character string
1681−text :: TypeExpression db (nullity 'PGtext)
1681+text :: TypeExpression schemas (nullity 'PGtext)
1682text = UnsafeTypeExpression "text"
1682text = UnsafeTypeExpression "text"
1683-- | fixed-length character string
1683-- | fixed-length character string
1684char, character
1684char, character
1685− :: forall n db nullity. (KnownNat n, 1 <= n)
1685+ :: forall n schemas nullity. (KnownNat n, 1 <= n)
1686− => TypeExpression db (nullity ('PGchar n))
1686+ => TypeExpression schemas (nullity ('PGchar n))
1687char = UnsafeTypeExpression $ "char(" <> renderNat @n <> ")"
1687char = UnsafeTypeExpression $ "char(" <> renderNat @n <> ")"
1688character = UnsafeTypeExpression $ "character(" <> renderNat @n <> ")"
1688character = UnsafeTypeExpression $ "character(" <> renderNat @n <> ")"
1689-- | variable-length character string
1689-- | variable-length character string
1690varchar, characterVarying
1690varchar, characterVarying
1691− :: forall n db nullity. (KnownNat n, 1 <= n)
1691+ :: forall n schemas nullity. (KnownNat n, 1 <= n)
1692− => TypeExpression db (nullity ('PGvarchar n))
1692+ => TypeExpression schemas (nullity ('PGvarchar n))
1693varchar = UnsafeTypeExpression $ "varchar(" <> renderNat @n <> ")"
1693varchar = UnsafeTypeExpression $ "varchar(" <> renderNat @n <> ")"
1694characterVarying = UnsafeTypeExpression $
1694characterVarying = UnsafeTypeExpression $
1695 "character varying(" <> renderNat @n <> ")"
1695 "character varying(" <> renderNat @n <> ")"
1696-- | binary data ("byte array")
1696-- | binary data ("byte array")
1697−bytea :: TypeExpression db (nullity 'PGbytea)
1697+bytea :: TypeExpression schemas (nullity 'PGbytea)
1698bytea = UnsafeTypeExpression "bytea"
1698bytea = UnsafeTypeExpression "bytea"
1699-- | date and time (no time zone)
1699-- | date and time (no time zone)
1700−timestamp :: TypeExpression db (nullity 'PGtimestamp)
1700+timestamp :: TypeExpression schemas (nullity 'PGtimestamp)
1701timestamp = UnsafeTypeExpression "timestamp"
1701timestamp = UnsafeTypeExpression "timestamp"
1702-- | date and time, including time zone
1702-- | date and time, including time zone
1703−timestampWithTimeZone :: TypeExpression db (nullity 'PGtimestamptz)
1703+timestampWithTimeZone :: TypeExpression schemas (nullity 'PGtimestamptz)
1704timestampWithTimeZone = UnsafeTypeExpression "timestamp with time zone"
1704timestampWithTimeZone = UnsafeTypeExpression "timestamp with time zone"
1705-- | calendar date (year, month, day)
1705-- | calendar date (year, month, day)
1706−date :: TypeExpression db (nullity 'PGdate)
1706+date :: TypeExpression schemas (nullity 'PGdate)
1707date = UnsafeTypeExpression "date"
1707date = UnsafeTypeExpression "date"
1708-- | time of day (no time zone)
1708-- | time of day (no time zone)
1709−time :: TypeExpression db (nullity 'PGtime)
1709+time :: TypeExpression schemas (nullity 'PGtime)
1710time = UnsafeTypeExpression "time"
1710time = UnsafeTypeExpression "time"
1711-- | time of day, including time zone
1711-- | time of day, including time zone
1712−timeWithTimeZone :: TypeExpression db (nullity 'PGtimetz)
1712+timeWithTimeZone :: TypeExpression schemas (nullity 'PGtimetz)
1713timeWithTimeZone = UnsafeTypeExpression "time with time zone"
1713timeWithTimeZone = UnsafeTypeExpression "time with time zone"
1714-- | time span
1714-- | time span
1715−interval :: TypeExpression db (nullity 'PGinterval)
1715+interval :: TypeExpression schemas (nullity 'PGinterval)
1716interval = UnsafeTypeExpression "interval"
1716interval = UnsafeTypeExpression "interval"
1717-- | universally unique identifier
1717-- | universally unique identifier
1718−uuid :: TypeExpression db (nullity 'PGuuid)
1718+uuid :: TypeExpression schemas (nullity 'PGuuid)
1719uuid = UnsafeTypeExpression "uuid"
1719uuid = UnsafeTypeExpression "uuid"
1720-- | IPv4 or IPv6 host address
1720-- | IPv4 or IPv6 host address
1721−inet :: TypeExpression db (nullity 'PGinet)
1721+inet :: TypeExpression schemas (nullity 'PGinet)
1722inet = UnsafeTypeExpression "inet"
1722inet = UnsafeTypeExpression "inet"
1723-- | textual JSON data
1723-- | textual JSON data
1724−json :: TypeExpression db (nullity 'PGjson)
1724+json :: TypeExpression schemas (nullity 'PGjson)
1725json = UnsafeTypeExpression "json"
1725json = UnsafeTypeExpression "json"
1726-- | binary JSON data, decomposed
1726-- | binary JSON data, decomposed
1727−jsonb :: TypeExpression db (nullity 'PGjsonb)
1727+jsonb :: TypeExpression schemas (nullity 'PGjsonb)
1728jsonb = UnsafeTypeExpression "jsonb"
1728jsonb = UnsafeTypeExpression "jsonb"
1729-- | variable length array
1729-- | variable length array
1730vararray
1730vararray
1731− :: TypeExpression db pg
1731+ :: TypeExpression schemas pg
1732− -> TypeExpression db (nullity ('PGvararray pg))
1732+ -> TypeExpression schemas (nullity ('PGvararray pg))
1733vararray ty = UnsafeTypeExpression $ renderTypeExpression ty <> "[]"
1733vararray ty = UnsafeTypeExpression $ renderTypeExpression ty <> "[]"
1734-- | fixed length array
1734-- | fixed length array
1735--
1735--
1736-- >>> renderTypeExpression (fixarray @2 json)
1736-- >>> renderTypeExpression (fixarray @2 json)
1737-- "json[2]"
1737-- "json[2]"
1738fixarray
1738fixarray
1739− :: forall n db nullity pg. KnownNat n
1739+ :: forall n schemas nullity pg. KnownNat n
1740− => TypeExpression db pg
1740+ => TypeExpression schemas pg
1741− -> TypeExpression db (nullity ('PGfixarray n pg))
1741+ -> TypeExpression schemas (nullity ('PGfixarray n pg))
1742fixarray ty = UnsafeTypeExpression $
1742fixarray ty = UnsafeTypeExpression $
1743 renderTypeExpression ty <> "[" <> renderNat @n <> "]"
1743 renderTypeExpression ty <> "[" <> renderNat @n <> "]"
1744
1744
1745-- | `pgtype` is a demoted version of a `PGType`
1745-- | `pgtype` is a demoted version of a `PGType`
1746−class PGTyped db (ty :: NullityType) where
1746+class PGTyped schemas (ty :: NullityType) where
1747− pgtype :: TypeExpression db ty
1747+ pgtype :: TypeExpression schemas ty
1748−instance PGTyped db (nullity 'PGbool) where pgtype = bool
1748+instance PGTyped schemas (nullity 'PGbool) where pgtype = bool
1749−instance PGTyped db (nullity 'PGint2) where pgtype = int2
1749+instance PGTyped schemas (nullity 'PGint2) where pgtype = int2
1750−instance PGTyped db (nullity 'PGint4) where pgtype = int4
1750+instance PGTyped schemas (nullity 'PGint4) where pgtype = int4
1751−instance PGTyped db (nullity 'PGint8) where pgtype = int8
1751+instance PGTyped schemas (nullity 'PGint8) where pgtype = int8
1752−instance PGTyped db (nullity 'PGnumeric) where pgtype = numeric
1752+instance PGTyped schemas (nullity 'PGnumeric) where pgtype = numeric
1753−instance PGTyped db (nullity 'PGfloat4) where pgtype = float4
1753+instance PGTyped schemas (nullity 'PGfloat4) where pgtype = float4
1754−instance PGTyped db (nullity 'PGfloat8) where pgtype = float8
1754+instance PGTyped schemas (nullity 'PGfloat8) where pgtype = float8
1755−instance PGTyped db (nullity 'PGtext) where pgtype = text
1755+instance PGTyped schemas (nullity 'PGtext) where pgtype = text
1756instance (KnownNat n, 1 <= n)
1756instance (KnownNat n, 1 <= n)
1757− => PGTyped db (nullity ('PGchar n)) where pgtype = char @n
1757+ => PGTyped schemas (nullity ('PGchar n)) where pgtype = char @n
1758instance (KnownNat n, 1 <= n)
1758instance (KnownNat n, 1 <= n)
1759− => PGTyped db (nullity ('PGvarchar n)) where pgtype = varchar @n
1759+ => PGTyped schemas (nullity ('PGvarchar n)) where pgtype = varchar @n
1760−instance PGTyped db (nullity 'PGbytea) where pgtype = bytea
1760+instance PGTyped schemas (nullity 'PGbytea) where pgtype = bytea
1761−instance PGTyped db (nullity 'PGtimestamp) where pgtype = timestamp
1761+instance PGTyped schemas (nullity 'PGtimestamp) where pgtype = timestamp
1762−instance PGTyped db (nullity 'PGtimestamptz) where pgtype = timestampWithTimeZone
1762+instance PGTyped schemas (nullity 'PGtimestamptz) where pgtype = timestampWithTimeZone
1763−instance PGTyped db (nullity 'PGdate) where pgtype = date
1763+instance PGTyped schemas (nullity 'PGdate) where pgtype = date
1764−instance PGTyped db (nullity 'PGtime) where pgtype = time
1764+instance PGTyped schemas (nullity 'PGtime) where pgtype = time
1765−instance PGTyped db (nullity 'PGtimetz) where pgtype = timeWithTimeZone
1765+instance PGTyped schemas (nullity 'PGtimetz) where pgtype = timeWithTimeZone
1766−instance PGTyped db (nullity 'PGinterval) where pgtype = interval
1766+instance PGTyped schemas (nullity 'PGinterval) where pgtype = interval
1767−instance PGTyped db (nullity 'PGuuid) where pgtype = uuid
1767+instance PGTyped schemas (nullity 'PGuuid) where pgtype = uuid
1768−instance PGTyped db (nullity 'PGjson) where pgtype = json
1768+instance PGTyped schemas (nullity 'PGjson) where pgtype = json
1769−instance PGTyped db (nullity 'PGjsonb) where pgtype = jsonb
1769+instance PGTyped schemas (nullity 'PGjsonb) where pgtype = jsonb
1770−instance PGTyped db ty
1770+instance PGTyped schemas ty
1771− => PGTyped db (nullity ('PGvararray ty)) where
1771+ => PGTyped schemas (nullity ('PGvararray ty)) where
1772− pgtype = vararray (pgtype @db @ty)
1772+ pgtype = vararray (pgtype @schemas @ty)
1773−instance (KnownNat n, PGTyped db ty)
1773+instance (KnownNat n, PGTyped schemas ty)
1774− => PGTyped db (nullity ('PGfixarray n ty)) where
1774+ => PGTyped schemas (nullity ('PGfixarray n ty)) where
1775− pgtype = fixarray @n (pgtype @db @ty)
1775+ pgtype = fixarray @n (pgtype @schemas @ty)