object Slick
Methods for interacting with relational databases using Slick and pekko-stream.
- Source
- Slick.scala
- Alphabetic
- By Inheritance
- Slick
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def flow[T](parallelism: Int, toStatement: (T) => DBIO[Int])(implicit session: SlickSession): Flow[T, Int, NotUsed]
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
- parallelism
How many parallel asynchronous streams should be used to send statements to the database. Use a value of 1 for sequential execution.
- toStatement
A function to produce the SQL statement to execute based on the current element.
- session
The database session to use.
- def flow[T](toStatement: (T) => DBIO[Int])(implicit session: SlickSession): Flow[T, Int, NotUsed]
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
- toStatement
A function to produce the SQL statement to execute based on the current element.
- session
The database session to use.
- def flowWithPassThrough[T, R](parallelism: Int, toStatement: (T) => DBIO[R])(implicit session: SlickSession): Flow[T, R, NotUsed]
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, then executes those statements against the specified Slick database and returns the statement result type R.
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, then executes those statements against the specified Slick database and returns the statement result type R.
- parallelism
How many parallel asynchronous streams should be used to send statements to the database. Use a value of 1 for sequential execution.
- toStatement
A function to produce the SQL statement to execute based on the current element.
- session
The database session to use.
- def flowWithPassThrough[T, R](toStatement: (T) => DBIO[R])(implicit session: SlickSession): Flow[T, R, NotUsed]
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, then executes those statements against the specified Slick database and returns the statement result type R.
Scala API: creates a Flow that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, then executes those statements against the specified Slick database and returns the statement result type R.
- toStatement
A function to produce the SQL statement to execute based on the current element.
- session
The database session to use.
- def sink[T](parallelism: Int, toStatement: (T) => DBIO[Int])(implicit session: SlickSession): Sink[T, Future[Done]]
Scala API: creates a Sink that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
Scala API: creates a Sink that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
- parallelism
How many parallel asynchronous streams should be used to send statements to the database. Use a value of 1 for sequential execution.
- toStatement
A function to produce the SQL statement to execute based on the current element.
- session
The database session to use.
- def sink[T](toStatement: (T) => DBIO[Int])(implicit session: SlickSession): Sink[T, Future[Done]]
Scala API: creates a Sink that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
Scala API: creates a Sink that takes a stream of elements of type T, transforms each element to a SQL statement using the specified function, and then executes those statements against the specified Slick database.
- toStatement
A function to produce the SQL statement to execute based on the current element.
- session
The database session to use.
- def source[T](streamingQuery: StreamingDBIO[Seq[T], T])(implicit session: SlickSession): Source[T, NotUsed]
Scala API: creates a Source[T, NotUsed] that performs the specified query against the (implicitly) specified Slick database and streams the results.
Scala API: creates a Source[T, NotUsed] that performs the specified query against the (implicitly) specified Slick database and streams the results. This works for both "typed" Slick queries and "plain SQL" queries.
- streamingQuery
The Slick query to execute, which can be either a "typed" query or a "plain SQL" query produced by one of the Slick "sql..." String interpolators
- session
The database session to use.