Skip to content

Commit

Permalink
Undo rename of fetchAll
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Maginnis committed Aug 26, 2014
1 parent a1d116b commit 6bb9e52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/sqlest/executor/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait ExecutorSyntax {
def fetchHeadOption[B](extractor: Extractor[B]): Option[extractor.SingleResult] =
database.executeSelect(select.what(extractor.columns))(row => extractor.extractHeadOption(row))

def fetchList[B](extractor: Extractor[B]): List[extractor.SingleResult] =
def fetchAll[B](extractor: Extractor[B]): List[extractor.SingleResult] =
database.executeSelect(select.what(extractor.columns))(row => extractor.extractList(row))

def fetchHead[SingleResult](implicit extractable: Extractable.Aux[A, SingleResult]): SingleResult =
Expand All @@ -36,7 +36,7 @@ trait ExecutorSyntax {
def fetchHeadOption[SingleResult](implicit extractable: Extractable.Aux[A, SingleResult]): Option[SingleResult] =
database.executeSelect(select)(row => extractable.extractor(select.what).extractHeadOption(row))

def fetchList[SingleResult](implicit extractable: Extractable.Aux[A, SingleResult]): List[SingleResult] =
def fetchAll[SingleResult](implicit extractable: Extractable.Aux[A, SingleResult]): List[SingleResult] =
database.executeSelect(select)(row => extractable.extractor(select.what).extractList(row))
}

Expand Down
6 changes: 3 additions & 3 deletions core/src/test/scala/sqlest/executor/ExecutorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class ExecutorSpec extends FlatSpec with Matchers {
)

"a select statement" should "be executable with an extractor" in {
selectStatement.fetchList(extractor)
selectStatement.fetchAll(extractor)
}

it should "be able to return all results" in {
val actualExtracted = selectStatement.fetchList(extractor)
val actualExtracted = selectStatement.fetchAll(extractor)

actualExtracted should equal(Seq(
One(1, "a"),
Expand Down Expand Up @@ -70,7 +70,7 @@ class ExecutorSpec extends FlatSpec with Matchers {
val headOption: Option[(String)] = select(TableOne.col2).from(TableOne).fetchHeadOption
headOption should be(Some("a"))

val all: List[(Int, String)] = select(TableOne.col1, TableOne.col2).from(TableOne).fetchList
val all: List[(Int, String)] = select(TableOne.col1, TableOne.col2).from(TableOne).fetchAll
all should equal(Seq(
(1, "a"),
(3, "c"),
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/scala/sqlest/examples/Extractor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object ExtractorExamples extends App with DatabaseExample {
.from(FruitTable)
.where(FruitTable.juiciness >= 8)
.orderBy(FruitTable.juiciness.desc)
.fetchList(fruitExtractor)
.fetchAll(fruitExtractor)

println(fruits)

Expand Down

0 comments on commit 6bb9e52

Please sign in to comment.