@@ -199,21 +199,21 @@ queryStatement q = UnsafeManipulation $ renderQuery q <> ";"
199199INSERT statements
200200-----------------------------------------}
201201
202−-- | Insert multiple rws.
202+-- | Insert multiple rows.
203203--
204204-- When a table is created, it contains no data. The first thing to do
205205-- before a database can be of much use is to insert data. Data is
206−-- conceptually inserted one rw at a time. Of course you can also insert
207−-- more than one rw, but there is no way to insert less than one rw.
208−-- Even if you know only some column values, a complete rw must be created.
206+-- conceptually inserted one row at a time. Of course you can also insert
207+-- more than one row, but there is no way to insert less than one row.
208+-- Even if you know only some column values, a complete row must be created.
209209insertRows
210210 :: ( SOP.SListI columns
211211 , SOP.SListI results
212212 , Has tab schema ('Table table)
213213 , columns ~ TableToColumns table )
214214 => Alias tab -- ^ table to insert into
215− -> NP (Aliased (ColumnValue '[] params)) columns -- ^ rw to insert
216− -> [NP (Aliased (ColumnValue '[] params)) columns] -- ^ more rws to insert
215+ -> NP (Aliased (ColumnValue '[] params)) columns -- ^ row to insert
216+ -> [NP (Aliased (ColumnValue '[] params)) columns] -- ^ more rows to insert
217217 -> ConflictClause columns params
218218 -- ^ what to do in case of constraint conflict
219219 -> ReturningClause columns params results -- ^ results to return
@@ -235,39 +235,39 @@ insertRows tab rw rws conflict returning = UnsafeManipulation $
235235 Default -> "DEFAULT"
236236 Set expression -> renderExpression expression
237237
238−-- | Insert a single rw.
238+-- | Insert a single row.
239239insertRow
240240 :: ( SOP.SListI columns
241241 , SOP.SListI results
242242 , Has tab schema ('Table table)
243243 , columns ~ TableToColumns table )
244244 => Alias tab -- ^ table to insert into
245− -> NP (Aliased (ColumnValue '[] params)) columns -- ^ rw to insert
245+ -> NP (Aliased (ColumnValue '[] params)) columns -- ^ row to insert
246246 -> ConflictClause columns params
247247 -- ^ what to do in case of constraint conflict
248248 -> ReturningClause columns params results -- ^ results to return
249249 -> Manipulation schema params results
250250insertRow tab rw = insertRows tab rw []
251251
252−-- | Insert multiple rws returning `Nil` and raising an error on conflicts.
252+-- | Insert multiple rows returning `Nil` and raising an error on conflicts.
253253insertRows_
254254 :: ( SOP.SListI columns
255255 , Has tab schema ('Table table)
256256 , columns ~ TableToColumns table )
257257 => Alias tab -- ^ table to insert into
258− -> NP (Aliased (ColumnValue '[] params)) columns -- ^ rw to insert
259− -> [NP (Aliased (ColumnValue '[] params)) columns] -- ^ more rws to insert
258+ -> NP (Aliased (ColumnValue '[] params)) columns -- ^ row to insert
259+ -> [NP (Aliased (ColumnValue '[] params)) columns] -- ^ more rows to insert
260260 -> Manipulation schema params '[]
261261insertRows_ tab rw rws =
262262 insertRows tab rw rws OnConflictDoRaise (Returning Nil)
263263
264−-- | Insert a single rw returning `Nil` and raising an error on conflicts.
264+-- | Insert a single row returning `Nil` and raising an error on conflicts.
265265insertRow_
266266 :: ( SOP.SListI columns
267267 , Has tab schema ('Table table)
268268 , columns ~ TableToColumns table )
269269 => Alias tab -- ^ table to insert into
270− -> NP (Aliased (ColumnValue '[] params)) columns -- ^ rw to insert
270+ -> NP (Aliased (ColumnValue '[] params)) columns -- ^ row to insert
271271 -> Manipulation schema params '[]
272272insertRow_ tab rw = insertRow tab rw OnConflictDoRaise (Returning Nil)
273273
@@ -300,11 +300,11 @@ insertQuery_
300300insertQuery_ tab query =
301301 insertQuery tab query OnConflictDoRaise (Returning Nil)
302302
303−-- | `ColumnValue`s are values to insert or update in a rw
303+-- | `ColumnValue`s are values to insert or update in a row
304304-- `Same` updates with the same value.
305305-- `Default` inserts or updates with the @DEFAULT@ value
306306-- `Set` a value to be an `Expression`, relative to the given
307−-- rw for an update, and closed for an insert.
307+-- row for an update, and closed for an insert.
308308data ColumnValue
309309 (columns :: RelationType)
310310 (params :: [NullityType])
@@ -317,14 +317,14 @@ data ColumnValue
317317 -> ColumnValue columns params (constraint :=> ty)
318318
319319-- | A `ReturningClause` computes and return value(s) based
320−-- on each rw actually inserted, updated or deleted. This is primarily
320+-- on each row actually inserted, updated or deleted. This is primarily
321321-- useful for obtaining values that were supplied by defaults, such as a
322322-- serial sequence number. However, any expression using the table's columns
323−-- is allowed. Only rws that were successfully inserted or updated or
324−-- deleted will be returned. For example, if a rw was locked
323+-- is allowed. Only rows that were successfully inserted or updated or
324+-- deleted will be returned. For example, if a row was locked
325325-- but not updated because an `OnConflictDoUpdate` condition was not satisfied,
326−-- the rw will not be returned. `ReturningStar` will return all columns
327−-- in the rw. Use @Returning Nil@ in the common case where no return
326+-- the row will not be returned. `ReturningStar` will return all columns
327+-- in the row. Use @Returning Nil@ in the common case where no return
328328-- values are desired.
329329data ReturningClause
330330 (columns :: ColumnsType)
@@ -352,8 +352,8 @@ renderReturningClause = \case
352352
353353-- | A `ConflictClause` specifies an action to perform upon a constraint
354354-- violation. `OnConflictDoRaise` will raise an error.
355−-- `OnConflictDoNothing` simply avoids inserting a rw.
356−-- `OnConflictDoUpdate` updates the existing rw that conflicts with the rw
355+-- `OnConflictDoNothing` simply avoids inserting a row.
356+-- `OnConflictDoUpdate` updates the existing row that conflicts with the row
357357-- proposed for insertion.
358358data ConflictClause (columns :: ColumnsType) params where
359359 OnConflictDoRaise :: ConflictClause columns params
@@ -393,7 +393,7 @@ UPDATE statements
393393-----------------------------------------}
394394
395395-- | An `update` command changes the values of the specified columns
396−-- in all rws that satisfy the condition.
396+-- in all rows that satisfy the condition.
397397update
398398 :: ( SOP.SListI columns
399399 , SOP.SListI results
@@ -403,7 +403,7 @@ update
403403 -> NP (Aliased (ColumnValue (ColumnsToRelation columns) params)) columns
404404 -- ^ modified values to replace old values
405405 -> Condition '[tab ::: ColumnsToRelation columns] 'Ungrouped params
406− -- ^ condition under which to perform update on a rw
406+ -- ^ condition under which to perform update on a row
407407 -> ReturningClause columns params results -- ^ results to return
408408 -> Manipulation schema params results
409409update tab columns wh returning = UnsafeManipulation $
@@ -424,7 +424,7 @@ update tab columns wh returning = UnsafeManipulation $
424424 Set expression `As` column -> Just $
425425 renderAlias column <+> "=" <+> renderExpression expression
426426
427−-- | Update a rw returning `Nil`.
427+-- | Update a row returning `Nil`.
428428update_
429429 :: ( SOP.SListI columns
430430 , Has tab schema ('Table table)
@@ -433,7 +433,7 @@ update_
433433 -> NP (Aliased (ColumnValue (ColumnsToRelation columns) params)) columns
434434 -- ^ modified values to replace old values
435435 -> Condition '[tab ::: ColumnsToRelation columns] 'Ungrouped params
436− -- ^ condition under which to perform update on a rw
436+ -- ^ condition under which to perform update on a row
437437 -> Manipulation schema params '[]
438438update_ tab columns wh = update tab columns wh (Returning Nil)
439439
@@ -441,14 +441,14 @@ update_ tab columns wh = update tab columns wh (Returning Nil)
441441DELETE statements
442442-----------------------------------------}
443443
444−-- | Delete rws of a table.
444+-- | Delete rows of a table.
445445deleteFrom
446446 :: ( SOP.SListI results
447447 , Has tab schema ('Table table)
448448 , columns ~ TableToColumns table )
449449 => Alias tab -- ^ table to delete from
450450 -> Condition '[tab ::: ColumnsToRelation columns] 'Ungrouped params
451− -- ^ condition under which to delete a rw
451+ -- ^ condition under which to delete a row
452452 -> ReturningClause columns params results -- ^ results to return
453453 -> Manipulation schema params results
454454deleteFrom tab wh returning = UnsafeManipulation $
@@ -456,13 +456,13 @@ deleteFrom tab wh returning = UnsafeManipulation $
456456 <+> "WHERE" <+> renderExpression wh
457457 <> renderReturningClause returning
458458
459−-- | Delete rws returning `Nil`.
459+-- | Delete rows returning `Nil`.
460460deleteFrom_
461461 :: ( Has tab schema ('Table table)
462462 , columns ~ TableToColumns table )
463463 => Alias tab -- ^ table to delete from
464464 -> Condition '[tab ::: ColumnsToRelation columns] 'Ungrouped params
465− -- ^ condition under which to delete a rw
465+ -- ^ condition under which to delete a row
466466 -> Manipulation schema params '[]
467467deleteFrom_ tab wh = deleteFrom tab wh (Returning Nil)
468468
@@ -480,11 +480,11 @@ WITH statements
480480-- let
481481-- manipulation :: Manipulation '["products" ::: 'Table ProductsTable, "products_deleted" ::: 'Table ProductsTable] '[ 'NotNull 'PGdate] '[]
482482-- manipulation = with
483−-- (deleteFrom #products (#date .< param @1) ReturningStar `As` #deleted_rws :* Nil)
484−-- (insertQuery_ #products_deleted (selectStar (from (view (#deleted_rws `As` #t)))))
483+-- (deleteFrom #products (#date .< param @1) ReturningStar `As` #deleted_rows :* Nil)
484+-- (insertQuery_ #products_deleted (selectStar (from (view (#deleted_rows `As` #t)))))
485485-- in renderManipulation manipulation
486486-- :}
487−-- "WITH \"deleted_rws\" AS (DELETE FROM \"products\" WHERE (\"date\" < ($1 :: date)) RETURNING *) INSERT INTO \"products_deleted\" SELECT * FROM \"deleted_rws\" AS \"t\";"
487+-- "WITH \"deleted_rows\" AS (DELETE FROM \"products\" WHERE (\"date\" < ($1 :: date)) RETURNING *) INSERT INTO \"products_deleted\" SELECT * FROM \"deleted_rows\" AS \"t\";"
488488with
489489 :: SOP.SListI commons
490490 => NP (Aliased (Manipulation schema params)) commons