| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PostgresqlTypes.Bpchar
Contents
Synopsis
- data Bpchar (numChars :: Nat)
- toText :: forall (numChars :: Nat). KnownNat numChars => Bpchar numChars -> Text
- toString :: forall (numChars :: Nat). KnownNat numChars => Bpchar numChars -> String
- refineFromText :: forall (numChars :: Nat). KnownNat numChars => Text -> Maybe (Bpchar numChars)
- normalizeFromText :: forall (numChars :: Nat). KnownNat numChars => Text -> Bpchar numChars
- refineFromString :: forall (numChars :: Nat). KnownNat numChars => String -> Maybe (Bpchar numChars)
- normalizeFromString :: forall (numChars :: Nat). KnownNat numChars => String -> Bpchar numChars
Documentation
data Bpchar (numChars :: Nat) Source #
PostgreSQL bpchar(n), char(n), or character(n) type. Fixed-length, blank-padded character string.
The type parameter numChars specifies the static length of the character string.
Only character strings with exactly this length can be represented by this type.
Important: Do not confuse this with the quoted "char" type, which is a special
single-byte internal type used in PostgreSQL system catalogs. The quoted "char" type
is represented by Char, not by Bpchar 1.
Bpchar nrepresentsbpchar(n),char(n), orcharacter(n)— fixed-length, blank-padded stringsCharrepresents"char"(quoted) — single-byte internal type
For example, char(1) in SQL is Bpchar 1 in Haskell, while "char" in SQL is
Char in Haskell. These are completely different types in PostgreSQL.
Instances
Accessors
toText :: forall (numChars :: Nat). KnownNat numChars => Bpchar numChars -> Text Source #
Extract the underlying Text value.
toString :: forall (numChars :: Nat). KnownNat numChars => Bpchar numChars -> String Source #
Convert the Bpchar to a String.
Constructors
refineFromText :: forall (numChars :: Nat). KnownNat numChars => Text -> Maybe (Bpchar numChars) Source #
normalizeFromText :: forall (numChars :: Nat). KnownNat numChars => Text -> Bpchar numChars Source #