on dev help sign in
nomenclature
commit532ce01778605e68ee51e35cf3292db5705d198d authorEitan Chatav <eitan.chatav@gmail.com> dateTue 18 Jul 2017, 11:23 (9 years ago) parentf53dc5b
1 file changed+17−17
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+17−17
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+17−17
@@ -306,17 +306,17 @@ instance OrdB (Expression params tables (optionality ('NotNull ty))) where
306306table expressions
307307-----------------------------------------}
308308
309−newtype TableExpression
309+newtype Table
310310 (params :: [ColumnType])
311311 (schema :: [(Symbol,[(Symbol,ColumnType)])])
312312 (columns :: [(Symbol,ColumnType)])
313− = UnsafeTableExpression { renderTableExpression :: ByteString }
313+ = UnsafeTable { renderTable :: ByteString }
314314 deriving (Show,Eq)
315315
316316class KnownSymbol table => HasTable table tables columns
317317 | table tables -> columns where
318− getTable :: Proxy# table -> TableExpression params tables columns
319− getTable table = UnsafeTableExpression $ fromString $ symbolVal' table
318+ getTable :: Proxy# table -> Table params tables columns
319+ getTable table = UnsafeTable $ fromString $ symbolVal' table
320320instance {-# OVERLAPPING #-} KnownSymbol table
321321 => HasTable table ((table ::: columns) ': tables) columns
322322instance {-# OVERLAPPABLE #-}
@@ -324,7 +324,7 @@ instance {-# OVERLAPPABLE #-}
324324 => HasTable table (table' ': schema) columns
325325
326326instance HasTable table schema columns
327− => IsLabel table (TableExpression params schema columns) where
327+ => IsLabel table (Table params schema columns) where
328328 fromLabel = getTable
329329
330330{-----------------------------------------
@@ -353,32 +353,32 @@ SELECT statements
353353
354354data Join params schema tables where
355355 Table
356− :: Aliased (TableExpression params schema) table
356+ :: Aliased (Table params schema) table
357357 -> Join params schema '[table]
358358 Subselect
359359 :: Aliased (Selection params schema) table
360360 -> Join params schema '[table]
361361 Cross
362− :: Aliased (TableExpression params schema) table
362+ :: Aliased (Table params schema) table
363363 -> Join params schema tables
364364 -> Join params schema (table ': tables)
365365 Inner
366− :: Aliased (TableExpression params schema) table
366+ :: Aliased (Table params schema) table
367367 -> Expression params (table ': tables) ('Required ('NotNull 'PGBool))
368368 -> Join params schema tables
369369 -> Join params schema (table ': tables)
370370 LeftOuter
371− :: Aliased (TableExpression params schema) right
371+ :: Aliased (Table params schema) right
372372 -> Expression params '[left,right] ('Required ('NotNull 'PGBool))
373373 -> Join params schema (tables)
374374 -> Join params schema (NullifyTable right ': left ': tables)
375375 RightOuter
376− :: Aliased (TableExpression params schema) right
376+ :: Aliased (Table params schema) right
377377 -> Expression params '[left,right] ('Required ('NotNull 'PGBool))
378378 -> Join params schema (left : tables)
379379 -> Join params schema (right ': NullifyTable left ': tables)
380380 FullOuter
381− :: Aliased (TableExpression params schema) right
381+ :: Aliased (Table params schema) right
382382 -> Expression params '[left,right] ('Required ('NotNull 'PGBool))
383383 -> Join params schema (left : tables)
384384 -> Join params schema
@@ -386,38 +386,38 @@ data Join params schema tables where
386386
387387renderJoin :: Join params schema tables -> ByteString
388388renderJoin = \case
389− Table table -> renderAliased renderTableExpression table
389+ Table table -> renderAliased renderTable table
390390 Subselect selection -> "SELECT " <> renderAliased renderSelection selection
391391 Cross table tables -> mconcat
392392 [ renderJoin tables
393393 , " CROSS JOIN "
394− , renderAliased renderTableExpression table
394+ , renderAliased renderTable table
395395 ]
396396 Inner table on tables -> mconcat
397397 [ renderJoin tables
398398 , " INNER JOIN "
399− , renderAliased renderTableExpression table
399+ , renderAliased renderTable table
400400 , " ON "
401401 , renderExpression on
402402 ]
403403 LeftOuter table on tables -> mconcat
404404 [ renderJoin tables
405405 , " LEFT OUTER JOIN "
406− , renderAliased renderTableExpression table
406+ , renderAliased renderTable table
407407 , " ON "
408408 , renderExpression on
409409 ]
410410 RightOuter table on tables -> mconcat
411411 [ renderJoin tables
412412 , " RIGHT OUTER JOIN "
413− , renderAliased renderTableExpression table
413+ , renderAliased renderTable table
414414 , " ON "
415415 , renderExpression on
416416 ]
417417 FullOuter table on tables -> mconcat
418418 [ renderJoin tables
419419 , " FULL OUTER JOIN "
420− , renderAliased renderTableExpression table
420+ , renderAliased renderTable table
421421 , " ON "
422422 , renderExpression on
423423 ]