mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-15 14:53:28 +03:00
Definition moved.
This commit is contained in:
parent
031027f1a2
commit
0572ca9cc9
@ -61,21 +61,18 @@ import qualified Language.SQL.Keyword.ConcatString as SQLs
|
|||||||
import Database.Record (PersistableWidth, PersistableRecordWidth, derivedWidth)
|
import Database.Record (PersistableWidth, PersistableRecordWidth, derivedWidth)
|
||||||
|
|
||||||
import Database.Relational.Query.Internal.String (paren, sqlRowString)
|
import Database.Relational.Query.Internal.String (paren, sqlRowString)
|
||||||
import Database.Relational.Query.Table (columnSQL, stringFromColumnSQL)
|
import Database.Relational.Query.Table (columnSQL)
|
||||||
import Database.Relational.Query.Expr (Expr, ShowConstantSQL (showConstantSQL))
|
import Database.Relational.Query.Expr (Expr, ShowConstantSQL (showConstantSQL))
|
||||||
import qualified Database.Relational.Query.Expr as Expr
|
import qualified Database.Relational.Query.Expr as Expr
|
||||||
import qualified Database.Relational.Query.Expr.Unsafe as UnsafeExpr
|
import qualified Database.Relational.Query.Expr.Unsafe as UnsafeExpr
|
||||||
|
|
||||||
import Database.Relational.Query.Pi (Pi, piZip)
|
import Database.Relational.Query.Pi (Pi, piZip)
|
||||||
|
|
||||||
import Database.Relational.Query.Projection (Projection, columns, unsafeFromColumns)
|
import Database.Relational.Query.Projection
|
||||||
|
(Projection, unsafeFromColumns, unsafeShowSqlProjection)
|
||||||
import qualified Database.Relational.Query.Projection as Projection
|
import qualified Database.Relational.Query.Projection as Projection
|
||||||
|
|
||||||
|
|
||||||
-- | Unsafely get SQL term from 'Proejction'.
|
|
||||||
unsafeShowSqlProjection :: Projection c r -> String
|
|
||||||
unsafeShowSqlProjection = sqlRowString . map stringFromColumnSQL . columns
|
|
||||||
|
|
||||||
-- | 'Expr' from 'Projection'
|
-- | 'Expr' from 'Projection'
|
||||||
exprOfProjection :: Projection c r -> Expr c r
|
exprOfProjection :: Projection c r -> Expr c r
|
||||||
exprOfProjection = UnsafeExpr.Expr . unsafeShowSqlProjection
|
exprOfProjection = UnsafeExpr.Expr . unsafeShowSqlProjection
|
||||||
|
@ -26,13 +26,16 @@ module Database.Relational.Query.Projection (
|
|||||||
|
|
||||||
flattenMaybe, just,
|
flattenMaybe, just,
|
||||||
|
|
||||||
unsafeToAggregated, unsafeToFlat
|
unsafeToAggregated, unsafeToFlat,
|
||||||
|
|
||||||
|
unsafeShowSqlProjection
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Prelude hiding (pi)
|
import Prelude hiding (pi)
|
||||||
|
|
||||||
|
import Database.Relational.Query.Internal.String (sqlRowString)
|
||||||
import Database.Relational.Query.Context (Aggregated, Flat)
|
import Database.Relational.Query.Context (Aggregated, Flat)
|
||||||
import Database.Relational.Query.Table (Table, ColumnSQL)
|
import Database.Relational.Query.Table (Table, ColumnSQL, stringFromColumnSQL)
|
||||||
import qualified Database.Relational.Query.Table as Table
|
import qualified Database.Relational.Query.Table as Table
|
||||||
import Database.Relational.Query.Pi (Pi)
|
import Database.Relational.Query.Pi (Pi)
|
||||||
import qualified Database.Relational.Query.Pi.Unsafe as UnsafePi
|
import qualified Database.Relational.Query.Pi.Unsafe as UnsafePi
|
||||||
@ -143,3 +146,7 @@ unsafeToAggregated = unsafeChangeContext
|
|||||||
-- | Unsafely down to flat context.
|
-- | Unsafely down to flat context.
|
||||||
unsafeToFlat :: Projection Aggregated r -> Projection Flat r
|
unsafeToFlat :: Projection Aggregated r -> Projection Flat r
|
||||||
unsafeToFlat = unsafeChangeContext
|
unsafeToFlat = unsafeChangeContext
|
||||||
|
|
||||||
|
-- | Unsafely get SQL term from 'Proejction'.
|
||||||
|
unsafeShowSqlProjection :: Projection c r -> String
|
||||||
|
unsafeShowSqlProjection = sqlRowString . map stringFromColumnSQL . columns
|
||||||
|
Loading…
Reference in New Issue
Block a user