packages feed

selda 0.1.11.1 → 0.1.11.2

raw patch · 4 files changed

+95/−10 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,6 +1,11 @@ # Revision history for Selda  +## 0.1.11.2 -- 2017-12-14++* Fix treatment of booleans in PostgreSQL backend.++ ## 0.1.11.1 -- 2017-10-10  * Fix rare infinite loop bug in in-process cache.
README.md view
@@ -9,16 +9,15 @@  What is Selda? ==============-Selda is an embedded domain-specific language for interacting with relational-databases. It was inspired by [LINQ](https://en.wikipedia.org/wiki/Language_Integrated_Query) and+[Selda](https://selda.link) is a Haskell library for interacting with SQL-based relational databases.+It was inspired by [LINQ](https://en.wikipedia.org/wiki/Language_Integrated_Query) and [Opaleye](http://hackage.haskell.org/package/opaleye).   Features ======== -* Monadic interface: no need to be a category theory wizard just to write a few-  database queries.+* Monadic interface. * Portable: backends for SQLite and PostgreSQL. * Generic: easy integration with your existing Haskell types. * Creating, dropping and querying tables using type-safe database schemas.@@ -28,8 +27,8 @@ * Transactions, uniqueness constraints and foreign keys. * Seamless prepared statements. * Configurable, automatic, consistent in-process caching of query results.-* Lightweight and modular: non-essential features are optional or split into-  add-on packages.+* Lightweight and modular: few dependencies, and non-essential features are+  optional or split into add-on packages.   Getting started@@ -718,8 +717,89 @@ [Haddock documentation](http://hackage.haskell.org/package/selda).  +Hacking+=======++Contributing+------------++All forms of contributions are welcome!++If you have a bug to report, please try to include as much information as+possible, preferably including:++* A brief description (one or two sentences) of the bug.+* The version of Selda+backend where the bug was found.+* A step-by-step guide to reproduce the bug.+* The *expected* result from following these steps.+* What *actually* happens when following the steps.+* Which component contains the bug (selda, selda-sqlite or selda-postgresql),+  if you're reasonably sure about where the bug is.++Bonus points for a small code example that illustrates the problem.++If you want to contribute code, please consult the following checklist before+sending a pull request:++* Does the code build with a recent version of GHC?+* Do all the tests pass?+* Have you added any tests covering your code?+++Setting up the build environment+--------------------------------++From the repository root:++* Install `libpq-dev` from your package manager.+    This is required to build the PostgreSQL backend.+* Run `make sandbox` followed by `make deps`.+    This will set up a local sandbox for your Selda hacking, and install all+    Haskell necessary dependencies.+* Familiarise yourself with the various targets in the makefile.+    The dependencies between Selda, the backends and the tests are slightly+    complex, so straight-up cabal is too quirky for day to day hacking.+++Setting up a VM for PostgreSQL testing+--------------------------------------++While the SQLite backend is completely self-contained, the PostgreSQL backend+needs an appropriate server for testing. Setting this up in a virtual machine+is definitely less intrusive than setting up a server on your development+machine. To set up a VM for the PostgreSQL backend tests:++* Install your favourite hypervisor, such as VMWare player or VirtualBox.+* Download a pre-built PostgreSQL VM from+    [Bitnami](https://bitnami.com/stack/postgresql/virtual-machine).+* Import the OVA file into your hypervisor.+* Change the network settings of your newly imported VM to NAT, and make sure+    that port 5432 is forwarded. Note that this will conflict with any PostgreSQL+    server running on your machine while the VM is running.+* Boot your VM and note the password displayed on the login screen.+* Create the file `selda-tests/PGConnectInfo.hs` with the following content:+    ```+    {-# LANGUAGE OverloadedStrings #-}+    module PGConnectInfo where+    import Database.Selda.PostgreSQL+    +    pgConnectInfo = "test" `on` "localhost" `auth` ("postgres", "$PASSWORD")+    ```+    Where `$PASSWORD` is the password from the VM's login screen.+* Log in to the VM and disable the built-in firewall by running+    `sudo systemctl disable ufw ; sudo systemctl stop ufw`.+* From your host machine, create the test database:+    ```+    $ psql -h 127.0.0.1 -U postgres -W+    [password from login screen]+    # CREATE TABLE test;+    # \q+    ```+* Run `make pgtest` to check that everything works.++ TODOs-=====+-----  Features that would be nice to have but are not yet implemented. 
selda.cabal view
@@ -1,5 +1,5 @@ name:                selda-version:             0.1.11.1+version:             0.1.11.2 synopsis:            Type-safe, high-level EDSL for interacting with relational databases. description:         This package provides an EDSL for writing portable, type-safe, high-level                      database code. Its feature set includes querying and modifying databases,
src/Database/Selda/SQL/Print/Config.hs view
@@ -13,7 +13,7 @@     -- | Parameter placeholder for the @n@th parameter.   , ppPlaceholder :: Int -> Text -    -- | List of column attributes, such as +    -- | List of column attributes.   , ppColAttrs :: [ColAttr] -> Text      -- | The value used for the next value for an auto-incrementing column.@@ -46,7 +46,7 @@ defType TRowID    = "INTEGER" defType TInt      = "INT" defType TFloat    = "DOUBLE"-defType TBool     = "INT"+defType TBool     = "BOOLEAN" defType TDateTime = "DATETIME" defType TDate     = "DATE" defType TTime     = "TIME"