Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d6y/typechecking-sql
Examples of type-checked SQL
https://github.com/d6y/typechecking-sql
Last synced: about 1 month ago
JSON representation
Examples of type-checked SQL
- Host: GitHub
- URL: https://github.com/d6y/typechecking-sql
- Owner: d6y
- License: apache-2.0
- Created: 2015-05-29T13:23:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-29T13:24:33.000Z (over 9 years ago)
- Last Synced: 2023-03-10T19:08:48.970Z (almost 2 years ago)
- Language: Scala
- Size: 141 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typechecking SQL in doobie and Slick
This project contains an example of type-checking SQL using Slick 3 and doobie.
## PostgreSQL
Both projects make use of a PostgreSQL database. You'll need to create this by hand:
```
$ psql
richard=# create database chat;
CREATE DATABASErichard=#\c chat
You are now connected to database "chat" as user "richard".chat=# create table "message" (
id serial primary key,
content varchar(255) not null
);
CREATE TABLE
```If you need to change connection details, take a look in the following files:
- _src/main/resources/application.conf_
- _src/main/scala/doobie.scala_
- _src/test/scala/query-specs.scala_## Slick 3
Run the example with:
```
$ sbt
sbt> runMain PlainSqlExample
```## doobie
Run the example with:
```
$ sbt
sbt> test
sbt> runMain DoobieExample
```