Skip to content

Commit 29690ef

Browse files
committed
Moved examples to test
1 parent 5fd9eb1 commit 29690ef

File tree

10 files changed

+21
-12
lines changed

10 files changed

+21
-12
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
cd pgvector
2020
make
2121
sudo make install
22-
- run: sbt run
22+
- run: sbt test

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ indexStmt.executeUpdate("CREATE INDEX my_index ON items USING ivfflat (embedding
5151

5252
Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
5353

54-
See a [full example](src/main/java/example1/JDBC.java)
54+
See a [full example](src/test/java/example1/JDBC.java)
5555

5656
## JDBC (Scala)
5757

@@ -90,7 +90,7 @@ indexStmt.executeUpdate("CREATE INDEX my_index ON items USING ivfflat (embedding
9090

9191
Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
9292

93-
See a [full example](src/main/scala/example2/JDBC.scala)
93+
See a [full example](src/test/scala/example2/JDBC.scala)
9494

9595
## Slick
9696

@@ -131,7 +131,7 @@ db.run(sqlu"CREATE INDEX my_index ON items USING ivfflat (embedding vector_l2_op
131131

132132
Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
133133

134-
See a [full example](src/main/scala/example2/Slick.scala)
134+
See a [full example](src/test/scala/example2/Slick.scala)
135135

136136
## Contributing
137137

@@ -148,5 +148,5 @@ To get started with development:
148148
git clone https://github.com/pgvector/pgvector-java.git
149149
cd pgvector-java
150150
createdb pgvector_java_test
151-
sbt run
151+
sbt test
152152
```

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ libraryDependencies ++= Seq(
22
"com.typesafe.slick" %% "slick" % "3.4.1",
33
"org.slf4j" % "slf4j-nop" % "1.7.26",
44
"org.postgresql" % "postgresql" % "42.5.0",
5+
"org.scalatest" %% "scalatest" % "3.2.15" % "test"
56
)

src/main/scala/Main.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/scala/MainTest.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import org.scalatest.funsuite.AnyFunSuite
2+
3+
class MainTest extends AnyFunSuite {
4+
test("example1.JDBC") {
5+
example1.JDBC.example()
6+
}
7+
8+
test("example2.JDBC") {
9+
example2.JDBC.example()
10+
}
11+
12+
test("example2.Slick") {
13+
example2.Slick.example()
14+
}
15+
}

0 commit comments

Comments
 (0)