GithubHelp home page GithubHelp logo

edo-vi / stringsaver Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 42 KB

Program to notes and strings in a local database. Made with Haskell.

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%

stringsaver's Introduction

stringsaver

CLI for saving notes and strings with a description in a local PostgreSQL database.

Written in Haskell; current version: 0.3.0

Usage

Build

To build the executable, you need Stack. Run

stack build

in the terminal: this will create an executable called stringsaver-exe in .stack-work/dist/<OS>/build/stringsaver-exe/

Fetching and saving data

The program needs you to have a running instance of PostgreSQL database in your machine, which will connect to when executed. The default username, database and table must be defined in Fill.hs: if you don't set these variables to your desired defaults, you will need to pass -u (username), -D (database), -t (table) as arguments to the program. Your table must have three columns: the primary key column and two Text columns, which will represent the string and the description respectively.

Fetch data

To fetch the data, run

stringsaver -r -D database -u user -t table

-r (read) is the default option so you can ommit it; if you have defined your default variables, then this command

stringsaver 

is equivalent to that above.

Save data

To save a string you need to use the -s (save) option, with an optional -d (description). The string you want to save is copied from you clipboard so you don't need to pass it explicitely, but you could do it with -l: if you have both data in your clipboard and passed a string explicitely, the latter will be saved. Note: if you pass explicitely a string with -l, it cannot have hyphens (-) in it.

Example:

stringsaver -s -d Descripion of the string

will save the data in your clipboard as the string and "Description of the string" as its description.

Remove data

To remove an entry you need to pass the program the -rm flag, alongside with -id <id of string>

Example

stringsaver -rm -id 27

will remove the row with an id of 27.

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.