SqlMappingLike

edu.gemini.grackle.sql.SqlMappingLike
trait SqlMappingLike[F[_]] extends CirceMappingLike[F] with SqlModule[F]

An abstract mapping that is backed by a SQL database.

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait SqlModule[F]
class Mapping[F]
class Object
trait Matchable
class Any
Known subtypes
class SqlMapping[F]
Self type

Members list

Concise view

Type members

Classlikes

case class AliasState(next: Int, seenTables: Set[String], tableAliases: Map[(List[String], String), String], seenColumns: Set[String], columnAliases: Map[(List[String], String), String], ownerChain: List[ColumnOwner])

State required to assign table and column aliases.

State required to assign table and column aliases.

Used when rendering an SqlQuery as a Fragment. Table aliases are assigned as needed for recursive queries. Column aliases are assigned to disambiguate collections of columns generated by subqueries and unions.

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object AliasState

Attributes

Companion:
class
Source:
SqlMapping.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Aliased

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Aliased.type
sealed trait ColumnOwner extends Product with Serializable

Trait representing an owner of an `SqlColumn

Trait representing an owner of an `SqlColumn

ColumnOwners are tables, SQL queries and subqueries, common table expressions and the like. Most, but not all have a name (SqlSelect, SqlUnion and SqlJoin being unnamed examples)

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
case class ColumnRef(table: String, column: String, codec: Codec, scalaTypeName: String, pos: SourcePos)

Name of a SQL schema column and its associated codec, Scala type an defining source position within an SqlMapping.

Name of a SQL schema column and its associated codec, Scala type an defining source position within an SqlMapping.

Columns are considered equal if their table and column names are equal.

Note that ColumnRef primarily play a role in mappings. During compilation they will be used to construct SqlColumns.

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class Join(conditions: List[(ColumnRef, ColumnRef)])

A pair of ColumnRefs, representing a SQL join.

A pair of ColumnRefs, representing a SQL join.

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Join

Attributes

Companion:
class
Source:
SqlMapping.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Join.type

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait MappedQuery

Represents the mapping of a GraphQL query to an SQL query

Represents the mapping of a GraphQL query to an SQL query

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class MultiRootCursor(roots: List[SqlCursor]) extends AbstractCursor

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cursor
class Object
trait Matchable
class Any
class RootDef

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
object SqlColumn

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait SqlColumn

Trait representing an SQL column

Trait representing an SQL column

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class SqlColumnTerm(col: SqlColumn) extends Term[Option[Unit]]

Wraps an SqlColumn as a Term which can appear in a Predicate

Wraps an SqlColumn as a Term which can appear in a Predicate

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Term[Option[Unit]]
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class SqlCursor(context: Context, focus: Any, mapped: MappedQuery, parent: Option[Cursor], env: Env) extends Cursor

Cursor positioned at a GraphQL result non-leaf

Cursor positioned at a GraphQL result non-leaf

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cursor
class Object
trait Matchable
class Any

Common super type for mappings which have a programmatic discriminator, ie. interface and union mappings.

Common super type for mappings which have a programmatic discriminator, ie. interface and union mappings.

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Discriminator for the branches of an interface/union

Discriminator for the branches of an interface/union

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
case class SqlField(fieldName: String, columnRef: ColumnRef, key: Boolean, discriminator: Boolean, hidden: Boolean, associative: Boolean)(implicit pos: SourcePos) extends SqlFieldMapping

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
sealed trait SqlFieldMapping extends FieldMapping

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
class SqlField
class SqlJson
class SqlObject

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
case class SqlJson(fieldName: String, columnRef: ColumnRef)(implicit pos: SourcePos) extends SqlFieldMapping

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class SqlObject(fieldName: String, joins: List[Join])(implicit pos: SourcePos) extends SqlFieldMapping

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object SqlObject

Attributes

Companion:
class
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object SqlQuery

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait SqlQuery extends ColumnOwner

Representation of a SQL query in a context

Representation of a SQL query in a context

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
class SqlSelect
class SqlUnion

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
object Table

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Table.type
sealed trait Table

Representation of an SQL query result

Representation of an SQL query result

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object EmptyTable.type
class TableDef(name: String)

Attributes

Source:
SqlMapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
object TableExpr

Attributes

Companion:
trait
Source:
SqlMapping.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait TableExpr extends ColumnOwner

Representation of a table expression

Representation of a table expression

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
case class TableName(name: String)

Attributes

Companion:
object
Source:
SqlMapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object TableName

Attributes

Companion:
class
Source:
SqlMapping.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Inherited classlikes

Attributes

Inherited from:
CirceMappingLike
Source:
circemapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cursor
class Object
trait Matchable
class Any

Attributes

Inherited from:
CirceMappingLike
Source:
circemapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
sealed trait CirceFieldMapping extends FieldMapping

Attributes

Inherited from:
CirceMappingLike
Source:
circemapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes

Attributes

Inherited from:
CirceMappingLike
Source:
circemapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CirceMappingLike
Source:
circemapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
trait FieldMapping extends Product with Serializable

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
case class LeafCursor(context: Context, focus: Any, parent: Option[Cursor], env: Env) extends Cursor

Cursor positioned at a GraphQL result leaf

Cursor positioned at a GraphQL result leaf

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cursor
class Object
trait Matchable
class Any

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
trait LeafMapping[T] extends TypeMapping

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
abstract class ObjectMapping extends TypeMapping

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class PrimitiveMapping(tpe: Type)(implicit pos: SourcePos) extends TypeMapping

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Root Cursor focussed on the top level operation of a query

Root Cursor focussed on the top level operation of a query

Construction of mapping-specific cursors is handled by delegation to mkCursorForField which is typically overridden inMapping` subtypes.

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cursor
class Object
trait Matchable
class Any
case class RootEffect extends FieldMapping

Root effects can perform an intial effect prior to computing the resulting Cursor and effective Query.

Root effects can perform an intial effect prior to computing the resulting Cursor and effective Query.

Convenience methods are provided to cover the cases where only one of the query or the cursor are computed, and for where the computation is one-shot or a Stream. One-shot effects are used to perform initial effectful setup for a query or to perform the effect associated with a GraphQL mutation. Stream effects are used for GraphQL subscriptions.

If only the query is computed the default root cursor for the mapping will be used. If only the cursor is computed the client query (after elaboration) is used unmodified ... in this case results of the performed effect can only be passed to the result construction stage via the environment associated with the returned cursor.

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object RootEffect

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
class Object
trait Matchable
class Any
trait SqlFragment[T] extends Monoid[T]

Typeclass for SQL fragments.

Typeclass for SQL fragments.

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala
Graph
Supertypes
trait Monoid[T]
trait Semigroup[T]
trait Serializable
class Object
trait Matchable
class Any
trait TypeMapping extends Product with Serializable

Attributes

Inherited from:
Mapping
Source:
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes

Types

type Aliased[T] = State[AliasState, T]

Attributes

Source:
SqlMapping.scala

Inherited types

type Codec

The type of a codec that reads and writes column values of type A.

The type of a codec that reads and writes column values of type A.

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala
type Encoder

The type of an encoder that writes column values of type A.

The type of an encoder that writes column values of type A.

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

The type of a fragment of SQL together with any interpolated arguments.

The type of a fragment of SQL together with any interpolated arguments.

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Value members

Concrete methods

def columnForAtomicField(context: Context, fieldName: String): Option[SqlColumn]

Returns the aliased column corresponding to the atomic field fieldName in context

Returns the aliased column corresponding to the atomic field fieldName in context

Attributes

Source:
SqlMapping.scala
def columnForSqlTerm[T](context: Context, term: Term[T]): Option[SqlColumn]

Returns the aliased columns corresponding to term in context

Returns the aliased columns corresponding to term in context

Attributes

Source:
SqlMapping.scala
def columnsForLeaf(context: Context, fieldName: String): List[SqlColumn]

Returns the columns for leaf field fieldName in context

Returns the columns for leaf field fieldName in context

Attributes

Source:
SqlMapping.scala
override def defaultRootCursor(query: Query, tpe: Type, env: Env): F[Result[(Query, Cursor)]]

Yields a Cursor focused on the top level operation type of the query

Yields a Cursor focused on the top level operation type of the query

Attributes

Definition Classes
Source:
SqlMapping.scala

Returns the discriminator columns for the context type

Returns the discriminator columns for the context type

Attributes

Source:
SqlMapping.scala

Returns the discriminator for the type at context

Returns the discriminator for the type at context

Attributes

Source:
SqlMapping.scala
def encoderForTerm(context: Context, term: Term[_]): Option[Encoder]

Returns the Encoder for the given term in context

Returns the Encoder for the given term in context

Attributes

Source:
SqlMapping.scala

Is the context type mapped to an associative table?

Is the context type mapped to an associative table?

Attributes

Source:
SqlMapping.scala
def isComputedField(context: Context, fieldName: String): Boolean

Is fieldName in context computed?

Is fieldName in context computed?

Attributes

Source:
SqlMapping.scala
def isJsonb(context: Context, fieldName: String): Boolean

Is fieldName in context Jsonb?

Is fieldName in context Jsonb?

Attributes

Source:
SqlMapping.scala
def isLocallyMapped(context: Context, query: Query): Boolean

Attributes

Source:
SqlMapping.scala
def isSingular(context: Context, fieldName: String, query: Query): Boolean

Does the supplied field correspond to a single, possibly structured, value?

Does the supplied field correspond to a single, possibly structured, value?

Attributes

Source:
SqlMapping.scala
def isSqlTerm(context: Context, term: Term[_]): Boolean

Is term in contextexpressible in SQL?

Is term in contextexpressible in SQL?

Attributes

Source:
SqlMapping.scala

Returns the key columns for the context type

Returns the key columns for the context type

Attributes

Source:
SqlMapping.scala
override def mkCursorForField(parent: Cursor, fieldName: String, resultName: Option[String]): Result[Cursor]

Yields a Cursor suitable for traversing the query result corresponding to the fieldName child of parent.

Yields a Cursor suitable for traversing the query result corresponding to the fieldName child of parent.

This method is typically overridden in and delegated to by Mapping subtypes.

Attributes

Definition Classes
Source:
SqlMapping.scala
def nonLeafList(context: Context, fieldName: String): Boolean

Does the type of fieldName in context represent a list of subobjects?

Does the type of fieldName in context represent a list of subobjects?

Attributes

Source:
SqlMapping.scala

Returns the table for the type at context

Returns the table for the type at context

Attributes

Source:
SqlMapping.scala

Attributes

Source:
SqlMapping.scala
def stripCompiled(query: Query, context: Context): Query

Operators which can be compiled to SQL are eliminated here, partly to avoid duplicating work programmatically, but also because the operation isn't necessarily idempotent and the result set doesn't necessarily contain the fields required for the filter predicates.

Operators which can be compiled to SQL are eliminated here, partly to avoid duplicating work programmatically, but also because the operation isn't necessarily idempotent and the result set doesn't necessarily contain the fields required for the filter predicates.

Attributes

Source:
SqlMapping.scala

Inherited methods

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Attributes

Inherited from:
CirceMappingLike
Source:
circemapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala
def fetch(fragment: Fragment, codecs: List[(Boolean, Codec)]): F[Vector[Array[Any]]]

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

True if the supplied type is a leaf with respect to the GraphQL schema or mapping, false otherwise.

True if the supplied type is a leaf with respect to the GraphQL schema or mapping, false otherwise.

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Yields the RootEffect, if any, associated with fieldName.

Yields the RootEffect, if any, associated with fieldName.

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Extract an encoder from a codec.

Extract an encoder from a codec.

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Concrete fields

Attributes

Source:
SqlMapping.scala

Inherited fields

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Attributes

Inherited from:
Mapping
Source:
mapping.scala

Implicits

Inherited implicits

Attributes

Inherited from:
SqlModule
Source:
SqlModule.scala
implicit val M: Monad[F]

Attributes

Inherited from:
Mapping
Source:
mapping.scala