You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/risto-stevcev/purescript-sqlite

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/risto-stevcev/purescript-sqlite

v3.0.0+incompatible
Source
Go
Version published
Created
Source

purescript-sqlite

Latest release

Installation

bower install purescript-sqlite

npm install sqlite3

Example

instance loremIsForeign :: IsForeign Lorem where
  read obj = do
    n <- readProp "info" obj
    pure $ Lorem { info: n }

instance showLorem :: Show Lorem where
  show (Lorem a) = a.info

data Lorem = Lorem { info :: String }

main :: forall e. Eff (err :: EXCEPTION, console :: CONSOLE, sqlite :: SQLITE | e)
                  (Canceler ( sqlite :: SQLITE, console :: CONSOLE | e ))
main = launchAff $ do
  db <- connect ":memory:" ReadWriteCreate
  run db "CREATE TABLE IF NOT EXISTS lorem (info TEXT)"
  run db ("INSERT INTO lorem VALUES (${value})" <-> [ "value" /\ "fooish!" ])
  rows <- get db "SELECT * from lorem" :: SqlRows Lorem
  close db

  case rows of
    Left err -> log (message err)
    Right rows' -> log $ show rows' 

This example logs [fooish!] to the console.

For more examples, see the unit tests and examples folder.

FAQs

Package last updated on 28 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts