| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Napkin.Run.Effects.Languages.SqlRead
Synopsis
- class (Eq (BackendSchemaField bk), Show (BackendSchemaField bk)) => HasBackendSchemaField (bk :: k) where
- data BackendSchemaField (bk :: k)
- fieldName :: BackendSchemaField bk -> Text
- fieldType :: BackendSchemaField bk -> Type
- data SqlRead (b :: k) (m :: k1) a where
- RunQuery :: forall {k} {k1} (b :: k) (m :: k1). Query -> SqlRead b m [Map Text Value]
- CheckTableExists :: forall {k} {k1} (b :: k) (m :: k1). Ref Table -> SqlRead b m Bool
- GetTableKind :: forall {k} {k1} (b :: k) (m :: k1). Ref Table -> SqlRead b m TableKind
- GetRelationSchema' :: forall {k} {k1} (b :: k) (m :: k1). Ref Table -> Relation -> SqlRead b m [BackendSchemaField b]
- checkTableExists :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r Bool
- getRelationSchema' :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Relation -> Sem r [BackendSchemaField b]
- getTableKind :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r TableKind
- runQuery :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Query -> Sem r [Map Text Value]
- runQuerySingleAnswer :: forall {k} (b :: k) a (r :: EffectRow). (Member (SqlRead b :: (Type -> Type) -> Type -> Type) r, Val a) => Query -> Sem r (Maybe a)
- getRelationSchema :: forall {k} (b :: k) (r :: EffectRow). Members '[SqlRead b :: (Type -> Type) -> Type -> Type, Input TemporaryTableName :: (Type -> Type) -> Type -> Type] r => Relation -> Sem r [BackendSchemaField b]
- type ColumnName = Text
- newtype RelationSchema (bk :: k) = RelationSchema (OMap ColumnName (BackendSchemaField bk))
- schemaColumnNames :: forall {k} (bk :: k). RelationSchema bk -> [ColumnName]
- getRelationSchema'' :: forall {k} (bk :: k) (r :: EffectRow). (HasBackendSchemaField bk, Members '[SqlRead bk :: (Type -> Type) -> Type -> Type, Input TemporaryTableName :: (Type -> Type) -> Type -> Type] r) => Relation -> Sem r (RelationSchema bk)
- fromBackendFields :: forall {k} (bk :: k). HasBackendSchemaField bk => [BackendSchemaField bk] -> RelationSchema bk
- data SchemaDiff (bk :: k) = SchemaDiff {
- addedColumns :: [BackendSchemaField bk]
- droppedColumns :: [BackendSchemaField bk]
- alteredColumns :: [(BackendSchemaField bk, BackendSchemaField bk)]
- diffRelationSchemas :: forall {k} (b :: k). HasBackendSchemaField b => RelationSchema b -> RelationSchema b -> SchemaDiff b
Documentation
class (Eq (BackendSchemaField bk), Show (BackendSchemaField bk)) => HasBackendSchemaField (bk :: k) where #
Associated Types
data BackendSchemaField (bk :: k) #
data SqlRead (b :: k) (m :: k1) a where #
Constructors
| RunQuery :: forall {k} {k1} (b :: k) (m :: k1). Query -> SqlRead b m [Map Text Value] | |
| CheckTableExists :: forall {k} {k1} (b :: k) (m :: k1). Ref Table -> SqlRead b m Bool | |
| GetTableKind :: forall {k} {k1} (b :: k) (m :: k1). Ref Table -> SqlRead b m TableKind | |
| GetRelationSchema' :: forall {k} {k1} (b :: k) (m :: k1). Ref Table -> Relation -> SqlRead b m [BackendSchemaField b] |
Instances
| (IsRenderable Query b, IsRenderable SExp b, IsRenderable Text b) => ToDumpItem (b :: k) (SqlRead b :: (Type -> Type) -> Type -> Type) # | |
| GShow (SqlRead b m :: Type -> Type) # | |
Defined in Napkin.Run.Effects.Languages.SqlRead Methods gshowsPrec :: Int -> SqlRead b m a -> ShowS # | |
| Show (SqlRead b m a) # | |
| Eq (SqlRead b m a) # | |
checkTableExists :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r Bool #
getRelationSchema' :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Relation -> Sem r [BackendSchemaField b] #
getTableKind :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Ref Table -> Sem r TableKind #
runQuery :: forall {k} (b :: k) (r :: EffectRow). Member (SqlRead b :: (Type -> Type) -> Type -> Type) r => Query -> Sem r [Map Text Value] #
runQuerySingleAnswer :: forall {k} (b :: k) a (r :: EffectRow). (Member (SqlRead b :: (Type -> Type) -> Type -> Type) r, Val a) => Query -> Sem r (Maybe a) #
Run a query and pull out the first column from its first row. Meant for queries that return a single result.
getRelationSchema :: forall {k} (b :: k) (r :: EffectRow). Members '[SqlRead b :: (Type -> Type) -> Type -> Type, Input TemporaryTableName :: (Type -> Type) -> Type -> Type] r => Relation -> Sem r [BackendSchemaField b] #
type ColumnName = Text #
newtype RelationSchema (bk :: k) #
Constructors
| RelationSchema (OMap ColumnName (BackendSchemaField bk)) |
Instances
schemaColumnNames :: forall {k} (bk :: k). RelationSchema bk -> [ColumnName] #
getRelationSchema'' :: forall {k} (bk :: k) (r :: EffectRow). (HasBackendSchemaField bk, Members '[SqlRead bk :: (Type -> Type) -> Type -> Type, Input TemporaryTableName :: (Type -> Type) -> Type -> Type] r) => Relation -> Sem r (RelationSchema bk) #
fromBackendFields :: forall {k} (bk :: k). HasBackendSchemaField bk => [BackendSchemaField bk] -> RelationSchema bk #
data SchemaDiff (bk :: k) #
Constructors
| SchemaDiff | |
Fields
| |
Instances
| Generic (SchemaDiff bk) # | |||||
Defined in Napkin.Run.Effects.Languages.SqlRead Associated Types
Methods from :: SchemaDiff bk -> Rep (SchemaDiff bk) x # to :: Rep (SchemaDiff bk) x -> SchemaDiff bk # | |||||
| type Rep (SchemaDiff bk) # | |||||
Defined in Napkin.Run.Effects.Languages.SqlRead type Rep (SchemaDiff bk) = D1 ('MetaData "SchemaDiff" "Napkin.Run.Effects.Languages.SqlRead" "napkin-spec-2.0.0-FCwBMuKrD3SKCvNJrhWp4k" 'False) (C1 ('MetaCons "SchemaDiff" 'PrefixI 'True) (S1 ('MetaSel ('Just "addedColumns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [BackendSchemaField bk]) :*: (S1 ('MetaSel ('Just "droppedColumns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [BackendSchemaField bk]) :*: S1 ('MetaSel ('Just "alteredColumns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(BackendSchemaField bk, BackendSchemaField bk)])))) | |||||
diffRelationSchemas :: forall {k} (b :: k). HasBackendSchemaField b => RelationSchema b -> RelationSchema b -> SchemaDiff b #