Easy Database Development Using Rekall
Listing 1. The On Display Function for the Philosophers Block
def eventFunc (block, row) : someMainForm = block.getForm(); currBlock = block; dataLabel = someMainForm.getNamedCtrl("current_philosopher"); dataLabel.setText(currBlock.getNamedCtrl("last_name").getValue());
Listing 2. The On Display Function for the Publications Block
def eventFunc (block, row) : mainForm = block.getForm(); currBlock = block; dataLabel = mainForm.getNamedCtrl("current_philosopher"); currBlock.setUserFilter(dataLabel.getValue());
Finally, I need some way of listing the philosophers I have in my database. Figure 7 shows the report functionality of Rekall.
Rekall also offers a number of other components, such as reports, queries and data copiers. Each component can be created with the same ease and offers the same versatility as the forms.
As I have demonstrated, Rekall and PostgreSQL offer the ability to complete all kinds of database programming tasks quickly under Linux while providing the cross-platform capability that many consultants need. As companies migrate to Linux for their desktops, products such as Rekall will come into far greater demand.
As it is configured after a default installation, PostgreSQL 8.0.2 authenticates its users by checking their Linux identities. To create a more secure application, you should change this to password authentication. The following steps describe how to do so.
First, modify the password of the database user postgres so that you can log in when passwords are required:
At a command prompt, type su and enter your root password.
Then, type su postgres.
Now, start the psql monitor by typing psql template1.
We modify the password by typing alter user postgres with password 'pgUser89' or some other suitable password.
Exit the monitor by typing \q and pressing Enter.
Second, modify the pg_hba.conf file so that the database accepts md5 passwords for all connections. By default, it's configured to authenticate based on the identity of the current Linux account. On a default installation, this file is found under /var/lib/pgsql/data. This file has lines that look like this:
# "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5
To enable passwords, change the trust option on the line for local to md5 and save the file. Then, restart PostgreSQL. On a Red Hat-like system, this can be done by issuing the command /sbin/service postgresql reload.
After this is done, users and databases can be created by using PostgreSQL's built-in tools or by using third-party tools such as PgAdminIII. The PostgreSQL Web site always is the best resource for more information on these topics.
Resources for this article: /article/8271.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
- August 2015 Issue of Linux Journal: Programming
- Django Models and Migrations
- Hacking a Safe with Bash
- Secure Server Deployments in Hostile Territory, Part II
- The Controversy Behind Canonical's Intellectual Property Policy
- Huge Package Overhaul for Debian and Ubuntu
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- KDE Reveals Plasma Mobile
- diff -u: What's New in Kernel Development