Skip to content

d6y/typechecking-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 DATABASE

richard=#\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

About

Examples of type-checked SQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages