Categories
c++ linux postgresql

Trying postgresql c++ interface : pqxx

Postgresql database have an official interface to C programming language and a C++ interface derived from that. C++ is a different language from C and i think it will be more easier to deal with.

Lets give a try on the newest linux mint 20.

1. install libpqxx-dev package (sudo apt-get install  libpqxx-dev).

2. install codelite IDE (sudo apt-get install  codelite).

3. install postgresql (sudo apt-get install postgresql).

4. create an user (user1) for connecting to postgresql.

Categories
mysql postgresql

Postgresql/Mysql : Selecting random rows

Let say we have a table containing famous quote and we want to show a random quote. How do that in postgresql ? Try this.

Select * from quote order by random() limit 1;

for Mysql use rand instead.

Select * from quote order by rand() limit 1;

 

Categories
OpenBSD postgresql sqlite3 tcl Tk

Installing TCL on OpenBSD 6.6

To bring tcl/tk programming language and some database connectivity for tcl on OpenBSD do command below as root :

pkg_add tcl tk sqlite3-tcl pgtcl

OpenBSD 6.6 can install tcl/tk 8.5 and 8.6.

Two extra package named sqlite3-tcl and pgtcl will give tcl capability to work with sqlite3 database and postgresql database.

Tdbc also a good choice for database connectivity. Tdbc packages on OpenBSD available for mysql, postgres, sqlite3. To add tdbc , we can do pkg_add tdbc-postgres tdbc-mysql tdbc-sqlite3.

Later will write more about tcl/tk.

Categories
manjaro postgresql

Setting up Postgresql on Manjaro Linux

Postgresql is one of my favorite database. I want it to be installed on my manjaro linux laptop. Open “add remove program” and install postgresql and pgadmin4. Its better to use pgadmin4 to manage your postgresql database than using psql cli based program.

Categories
jruby OpenBSD postgresql ruby

Ruby Sequel Web Application

Finally im able to create a simple web application using ruby with sinatra,sequel, postgres.