Definition moved.

This commit is contained in:
Kei Hibino 2013-08-30 01:05:33 +09:00
parent 031027f1a2
commit 0572ca9cc9
2 changed files with 12 additions and 8 deletions

View File

@ -61,21 +61,18 @@ import qualified Language.SQL.Keyword.ConcatString as SQLs
import Database.Record (PersistableWidth, PersistableRecordWidth, derivedWidth)
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 qualified Database.Relational.Query.Expr as Expr
import qualified Database.Relational.Query.Expr.Unsafe as UnsafeExpr
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
-- | Unsafely get SQL term from 'Proejction'.
unsafeShowSqlProjection :: Projection c r -> String
unsafeShowSqlProjection = sqlRowString . map stringFromColumnSQL . columns
-- | 'Expr' from 'Projection'
exprOfProjection :: Projection c r -> Expr c r
exprOfProjection = UnsafeExpr.Expr . unsafeShowSqlProjection

View File

@ -26,13 +26,16 @@ module Database.Relational.Query.Projection (
flattenMaybe, just,
unsafeToAggregated, unsafeToFlat
unsafeToAggregated, unsafeToFlat,
unsafeShowSqlProjection
) where
import Prelude hiding (pi)
import Database.Relational.Query.Internal.String (sqlRowString)
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 Database.Relational.Query.Pi (Pi)
import qualified Database.Relational.Query.Pi.Unsafe as UnsafePi
@ -143,3 +146,7 @@ unsafeToAggregated = unsafeChangeContext
-- | Unsafely down to flat context.
unsafeToFlat :: Projection Aggregated r -> Projection Flat r
unsafeToFlat = unsafeChangeContext
-- | Unsafely get SQL term from 'Proejction'.
unsafeShowSqlProjection :: Projection c r -> String
unsafeShowSqlProjection = sqlRowString . map stringFromColumnSQL . columns