-
Added
instance Default Updater (Field_ n a) ()
-
Added
omitOnWriteTableField
-
Added
inMany
and removedFunctor
constraint fromin_
.
- Improve Haddock
- Added
enumShowSqlType
andsqlTypeWithSchema
(thanks to @stevemao)
- Documentation improvements
- Documentation improvements
- Fixed bug that generated broken queries when using ordered
aggregateOrdered
withdistinctAggregator
, and when using set aggregation.
-
Added
isJustAnd
-
Add
withMaterialized
(thanks to Shane O'Brien) -
Added 'dateTruncTimestamp
and
dateTruncTimestamptz` (thanks to @njaremko)
- Fix bugs in
WITH
. See #572 (thanks to Shane O'Brien)
- Added
withRecursiveDistinct
(thanks to Shane O'Brien)
-
Changed
relationValuedExpr
to work in more cases. (This is a breaking change to an internal function.) -
Removed the following, which were all previously deprecated:
valuesSafe
,valuesSafeExplicit
,valuesUnsafe
,valuesUnsafeExplicit
,ValuesspecSafe
,fieldQueryRunnerColumn
,fieldParserQueryRunnerColumn
,queryRunner
,joinF
,leftJoinF
,rightJoinF
,fromFieldToFieldsEnum
,keepWhen
See their documentation in the 0.9 series to learn about their replacements.
- Added
filterWhere
(thanks to Shane O'Brien)
- No externally visible changes
- No externally visible changes
- Add
Opaleye.Window
to support window functions. Thanks to Shane O'Brien.
- Actually expose
arrayAgg_
- Add
arrayAgg_
for aggregating nullable fields
- Actually expose
ascNullsLast
anddescNullsFirst
.
-
Added
instance DefaultFromField (T.SqlArray_ Nullable a) [Maybe b]
-
Changed
ascNullsFirst
anddescNullsLast
to work with nullable fields. This rectifies an oversight from theColumn
toField
change. This may technically be a PVP violation but I think the risk of breakage is very small. If you experience breakage please report it on the issue tracker. -
Added
ascNullsLast
anddescNullsFirst
. -
Thanks to @abigailalice for pointing out the oversights in the
Column
toField
change.
-
No externally visible changes
-
Substantial internal changes to
Opaleye.Values
- No externally visible changes
- No externally visible changes
-
Add
with
andwithRecursive
(thanks to Erik Hesselink and Shane O'Brien). -
Add
Default ToFields
andDefaultFromField
instances for postgresql-simple'sAeson
(thanks to Bas Van Dijk).
- Added
nullableToMaybeFields
andmaybeFieldsToNullable
-
Added
distinctOnExplicit
anddistinctOnByExplicit
-
Added
label'
as a future replacement forlabel
-
Exported
SqlFractional
fromOpaleye.SqlTypes
-
Fixed a bug in
forUpdate
-
The internal implementation of
QueryArr
has changed.
The switch from Column
to Field
is complete. This is a small yet
pervasive change. To update your code please change all usages of
Column
as follows:
Column
of a non-nullable type: toField
Column
of a nullable type: toFieldNullable
Column
of a nullability-polymorphic type: toField_ n
For example
Column SqlText
->Field SqlText
Column (Nullable SqlInt4)
->FieldNullable SqlInt4
Column a
->Field_ n a
This is the only change that has been made in this version, in order to ease user transition.
- See also #326
- Cosmetic and re-export changes only.
- Support GHC 9.2
-
Removed the following deprecated functions, types and modules
Opaleye.Query
,Query
,QueryArr
,queryRunnerColumnDefault
Opaleye.RunQuery
,runQuery
,runQueryFold
,queryRunnerColumn
Opaleye.Constant
,constant
- The
Table
andTableWithSchema
constructors View
,Writer
,required
,optional
,readOnly
,tableColumn
,queryTable
Nulled
,leftJoinInferrable
,rightJoinInferrable
,fullJoinInferrable
unpackspecColumn
TableField
runInsertManyReturningOnConflictDoNothing
,runInsertManyReturning
,runUpdateEasy
,runUpdateReturning
,runDelete
charLength
,exists
,notExists
,inQuery
PGIsJson
,PGOrd
,PG<typename>
showSqlForPostgres
,showSqlForPostgresUnopt
-
Replaced the following old internal names
QueryRunnerColumnDefault
->DefaultFromField
QueryRunnerColumn
->FromField
(type alias and constructor)QueryRunner
->FromFields
(type alias and constructor)
-
Opaleye.Join.optional
exported from top-level -
Bug fix:
distinctOn
anddistinctOnBy
now return a single row if zero columns are chosen to be distinct. -
Add
runInsert
/Update
/Delete
without underscore
Fix ISO 8601 date formatting. Thanks to Michal @kozak.
No user-visible changes
-
Added
matchMaybe
-
Added
SqlVarcharN
and supporting functions
-
Added
enumMapperWithSchema
. Thanks to Steve Mao. -
Added
SqlInterval
. Thanks to Bas van Dijk.
- Added
distinctOnCorrect
anddistinctOnByCorrect
which will replacedistinctOn
anddistinctOnBy
in a future version.
- Added DefaultFromField SqlJson(b) instances for Strict/Lazy Text/ByteString. Thanks to Nathan Jaremko.
-
Added
jsonAgg
,jsonBuildObject
andjsonBuildObjectField
. Thanks to Nathan Jaremko. -
Added
now
function. Thanks to Nathan Jaremko. -
Added
Opaleye.Exists.exists
. Thanks to @duairc. -
Added
Opaleye.Experimental.Enum
-
Added
Opaleye.Operators.array_position
andOpaleye.Operators.sqlElem
. Thanks to Ashesh Ambasta.
-
Added
Opaleye.Experimental.Enum
for an easy way to deal with PostgresENUM
types. -
Added
Opaleye.Manipulation.rReturningI
which has better type inference. -
Added
Opaleye.Operators.where_
for easier restriction in monadic style. -
Added
Opaleye.Operators.sqlLength
andOpaleye.Operators.dateOfTimestamp
.
-
Many renamings have taken place to help make Opaleye easier to understand. The old versions have been deprecated.
-
All previously deprecated functions have been removed.
Old | New |
---|---|
Query | Select |
QueryArr | SelectArr |
PGType | SqlType |
PGClass | SqlClass |
Constant | ToFields |
QueryRunner | FromFields |
QueryRunnerColumn | FromField |
QueryRunnerColumnDefault | DefaultFromField |
TableProperties | TableFields |
optional | optionalTableField |
required | requiredTableField |
readOnly | readOnlyTableField |
-
Added
Opaleye.RunSelect.runSelectI
andOpaleye.ToFields.toFieldsI
which have better inferability. -
Preliminary
FOR UPDATE
support inOpaleye.Internal.Locking
. -
Added
fromFieldArray
for makingFromField
s for arrays.
-
Thanks to Shane (@duairc) and Ollie Charles (@ocharles) for writing most of the
lateral
- andMaybeFields
-related code in this release. -
Add a
Monad
instance forSelect
(andSelectArr i
). -
Add
Opaleye.Lateral
, to support LATERAL subqueries. -
Add
Opaleye.Join.optionalRestrict
andOpaleye.Join.optional
, as more convenient and composable ways of doing left/right joins. -
Add
Opaleye.MaybeFields
-
Add
optionalTableField
,readOnlyTableField
,requiredTableField
, to replaceoptional
,readOnly
andrequired
in a later version. -
Add
valuesSafe
, a version ofvalues
.values
of an empty list generates incorrect queries when mixed with @OUTER@/@LEFT@/@RIGHT JOIN@s.valuesSafe
will replace it in version 0.7 -
Add
Opaleye.Adaptors
as the forward-compatible place to importUnpackspec
andunpackspecField
from, as well as other adaptors. -
Unicode characters are escaped properly in
sqlString
/toFields
-
Add
inSelect
, to replaceinQuery
in a future version. -
Add
unsafeCoerceField
, to replaceunsafeCoerceColumn
in a future version. -
Generalise label to type
label :: String -> S.SelectArr a b -> S.SelectArr a b
-
Fix invalid queries bug in
union
,unionAll
,except
andexceptAll
where one side was empty.
- No user-visible changes
-
Fixed exponential slowdown in
removeEmpty
. -
Fixed
read
compatibility with time-1.9 in test suite.
-
Many changes to the documentation that use the new names. See entry for version 0.6.7000.0.
-
Added
fromPGSFromField
to replacefieldQueryRunnerColumn
. -
Added
fromPGSFieldParser
to replacefieldParserQueryRunnerColumn
. -
Added
defaultFromField
to replacequeryRunnerColumnDefault
. -
Added
tableField
to replacetableColumn
. -
Added
unsafeFromField
to replacequeryRunnerColumn
. -
Added
toFieldsExplicit
to replaceconstantExplicit
. -
Added
TableRecordField
to replaceTableField
inOpaleye.TypeFamilies
. The latter may be used to replaceTableColumn
in the future. -
Added array functions
arrayAppend
,arrayRemove
,arrayRemoveNulls
.
- Bumped some dependencies so there is an install plan on GHC 8.6
-
Add
tableField
as a future replacement fortableColumn
-
Export
Opaleye.Field
andOpaleye.RunSelect
fromOpaleye
-
Use new nomenclature in tutorials
This is a breaking release that doesn't follow the PVP but because it's essentially a pre-release for version 0.7 I'm just going to blacklist the broken versions on Hackage and forget about it.
- Swapped
N
andNN
because they were the wrong way round.
-
Fix bug with infinity in range bounds
-
Fix incompatibility with GHC 8.4
-
Add range accessors,
upperBound
andlowerBound
-
Add
distinctOn
anddistinctOnBy
This is a pre-release of version 0.7.0.0. GHC >= 8.0 is required. It contains the following new important features
-
A new API for manipulation, including
ON CONFLICT DO NOTHING
support forUPDATE
-
Initial support for product types written in "Higher kinded data" style (but deriving of related functionality using TH or Generics is not yet provided).
-
Type inference for outer joins
-
Many renamings. In particular,
Column
will becomeField
in 0.7.0.0. You should be able to almost completely port your code to the 0.7.0.0 names whilst remaining compatible with 0.6.7000.0.
-
Added
Opaleye.RunSelect
-
Added
Opaleye.Field
-
queryTable
is renamedselectTable
-
Query
/QueryArr
are renamedSelect
/SelectArr
-
QueryRunner
is renamedFromFields
-
QueryRunnerColumn
is renamedFromField
-
Constant
is renamedToFields
-
constant
is renamedtoFields
-
Added
Opaleye.SqlTypes
andsql
/Sql...
names instead ofpg
/PG...
names -
Added
runInsert_
,runUpdate_
,runDelete_
and supporting functionality -
Add
PGNumeric
type -
Added
leftJoinA
-
Added
liesWithin
-
Added
ZonedTime
toPGTimestamptz
mappings -
ArrowChoice
instance forQueryArr
-
Added
runUpdateEasy
-
Deprecated
Show
instance ofColumn a
Manipulation.arrange...
showPGType
literalColumn
unsafePgFormatTime
prepareQuery
formatAndShowSQL
-
Removed
unsafeCoerce
-
Added
TableColumn
andtableColumn
which selectsoptional
orrequired
based on write type. -
Added
TableColumns
as synonym forTableProperties
.TableProperties
will be deprecated in version 0.7. -
Added
table
as synonym forTable
.Table
will be deprecated in version 0.7. -
Added
tableWithSchema
as synonym forTableWithSchema
.Table
will be deprecated in version 0.7. -
Replaced
ColumnMaker
withUnpackspec
, which is identical to it. -
Added
Profunctor
instance forTable
-
Added
restrictExists
andrestrictNotExists
as synonyms forexists
andnotExists
. The latter will be deprecated in version 0.7.
- Added cursor interface (
Cursor
and friends)
distinctAggregator
,joinNullable
,exists
,notExists
,index
,timestamptzAtTimeZone
- Added support for range types
- Corrected fixity for .&&
- Improved documentation
- Added
Opaleye.FunctionalJoin
- Fixed handling of
BinExpr OpIn _ (ListExpr _)
indefaultSqlExpr
. in_
now actually uses the SQLIN
operator.- Added support for
ILIKE
- Added
- support for JSON operators
- Many improvements to the Haddocks
- RIGHT and FULL OUTER joins
- Added
(.===)
,aggregateOrdered
,countStar
,countRows
,quot_
,rem_
, 'charLength`- intersection and except query binary operators
Constant
instances forMaybe
and listsrunInsertManyReturning
runQueryFold
- Added
.===
and./==
for comparison of product types - Added
keepWhen
as an alternative torestrict
- Added
constant
conversion to and from Aeson - Added
pgValueJSON
andpgValueJSONB
- Added
Opaleye.Constant
for lifting constant values - Support microseconds in
pgLocalTime
,pgTimeOfDay
andpgUTCTime
- Added
unsafeCompositeField
to help with defining composite types Order
is an instance ofSemigroup
Thanks to Adam Bergmark and Matt Wraith for helping with these changes.
- Added
runUpdateReturning
- Ordering operators and
max
andmin
aggregators are now restricted to a typeclass - Added
stringAgg
andarrayAgg
aggregations. - Added
PGOrd
typeclass for typesafe ordering operations. - Support sorting NULLs first or last with
ascNullsFirst
anddescNullsLast
- Added JSON types
- Added
runInsertMany
Thanks to Travis Staton, Jakub Ryška and Christopher Lewis for helping with these changes.
- Use time >= 1.4 and time-locale-compat
- Bump time to >= 1.5
- SQL code generator escapes column names, so table column names can be the same as SQL keywords.
- Add
like
operator - Add the types
PGCitext
,PGArray
,PGBytea
- Replace
Default QueryRunner
with a new classDefaultQueryRunnerColumn
, migrate withs/Default QueryRunner/DefaultQueryRunnerColumn
ands/def/queryRunnerColumnDefault/
- Remove
ShowConstant
, use the monomorphic functions defined in the new moduleOpaleye.PGTypes
instead. You will need to replaceColumn Bool
withColumn PGBool
etc. in query signatures - Re-export more modules from
Opaleye
- Add
boolAnd
,boolOr,
max
, andmin
aggregators - Add
lower
andupper
- Add operator fixities
- Add
maybeToNullable
- Add column instances for
Bool
,UUID
,Text
, andUTCTime
- Expose fieldQueryRunnerColumn from Opaleye.RunQuery
- Add
unsafeCast
- Re-export
Unpackspec
fromOpaleye.Manipulation