Git Product home page Git Product logo

slick-postgis-demo's Introduction

Use PostGis with Slick3

Slick can be a bit mysteric when we have to extend it with new datatypes.

This demo project is looking to provide an example to extend slick with the ability to work with PostGis on POSTGRESQL.

Overview

This is a play 2.6 project. Slick is integrated via the play-slick project. The other relevant dependencies are as below:

  • Slick 3.2.0.
  • postgis-jdbc 2.2.1
  • postgresql driver 42.2.2

The test runs on JDK 1.8, scala 2.12.2. Using postgresql 10 + PostGis 2.4.

Preparation

We need to have a postgresql database with postgis installed.

Install vagrant and use vagrant up to provision a testing postgresql.

The test postgresql runs on host 168.95.56.98. Use the below credential to manage.

  • username: postgres
  • password: postgres

If you need SSH access, use the below

  • username: vagrant
  • password: vagrant
  • Or simply run vagrant ssh from command line.

Manually prepare the database by creating a new user and database.

-- connect with postgres/postgres
CREATE USER test WITH CREATEDB LOGIN INHERIT PASSWORD 'test';
CREATE DATABASE test OWNER test;

-- connect with postgres/postgres with database test. Ex: \c test in psql
CREATE EXTENSION postgis;

If you wish to use an existing postgresql database, please change conf/application.conf accordingly.

Running

The project has no api or frontend, execute the few test cases from sbt.

sbt test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.