Class

org.bitcoins.db

CRUD

Related Doc: package db

Permalink

abstract class CRUD[T, PrimaryKeyType] extends DatabaseLogger

Created by chris on 9/8/16. This is an abstract actor that can be used to implement any sort of actor that accesses a Postgres database. It creates read, update, upsert, and delete methods for your actor to call. You are responsible for the create function. You also need to specify the table and the database you are connecting to.

Linear Supertypes
DatabaseLogger, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CRUD
  2. DatabaseLogger
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CRUD()(implicit config: AppConfig, ec: ExecutionContext)

    Permalink

Abstract Value Members

  1. abstract def createAll(ts: Vector[T]): Future[Vector[T]]

    Permalink
  2. abstract def findAll(ts: Vector[T]): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], T, Seq]

    Permalink
    Attributes
    protected
  3. abstract def findByPrimaryKeys(ids: Vector[PrimaryKeyType]): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], T, Seq]

    Permalink

    Finds the rows that correlate to the given primary keys

    Finds the rows that correlate to the given primary keys

    Attributes
    protected
  4. abstract val table: slick.jdbc.JdbcProfile.API.TableQuery[_ <: slick.jdbc.JdbcProfile.API.Table[T]]

    Permalink

    The table inside our database we are inserting into

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def count(): Future[Int]

    Permalink

    Returns number of rows in the table

  7. def create(t: T): Future[T]

    Permalink

    create a record in the database

    create a record in the database

    t

    - the record to be inserted

    returns

    the inserted record

  8. def database: SafeDatabase

    Permalink

    Binding to the actual database itself, this is what is used to run querys

  9. def delete(t: T): Future[Int]

    Permalink

    delete the corresponding record in the database

    delete the corresponding record in the database

    t

    - the record to be deleted

    returns

    int - the number of rows affected by the deletion

  10. def deleteAll(): Future[Int]

    Permalink

    delete all records from the table

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def find(t: T): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], T, Seq]

    Permalink

    return the row that corresponds with this record

    return the row that corresponds with this record

    t

    - the row to find

    returns

    query - the sql query to find this record

    Attributes
    protected
  15. def findAll(): Future[Vector[T]]

    Permalink

    Finds all elements in the table

  16. def findByPrimaryKey(id: PrimaryKeyType): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[_], T, Seq]

    Permalink

    return all rows that have a certain primary key

    return all rows that have a certain primary key

    returns

    Query object corresponding to the selected rows

    Attributes
    protected
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def logger(implicit config: AppConfig): MarkedLogger

    Permalink
    Attributes
    protected[org.bitcoins]
    Definition Classes
    DatabaseLogger
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. def read(id: PrimaryKeyType): Future[Option[T]]

    Permalink

    read a record from the database

    read a record from the database

    id

    - the id of the record to be read

    returns

    Option[T] - the record if found, else none

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. def update(t: T): Future[T]

    Permalink

    Update the corresponding record in the database

  28. def updateAll(ts: Vector[T]): Future[Vector[T]]

    Permalink

    Updates all of the given ts in the database

  29. def upsert(t: T): Future[T]

    Permalink

    insert the record if it does not exist, update it if it does

    insert the record if it does not exist, update it if it does

    t

    - the record to inserted / updated

    returns

    t - the record that has been inserted / updated

  30. def upsertAll(ts: Vector[T]): Future[Vector[T]]

    Permalink

    Upserts all of the given ts in the database, then returns the upserted values

  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DatabaseLogger

Inherited from AnyRef

Inherited from Any

Ungrouped