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.
Webinar: 8 Signs You’re Beyond Cron
11am CDT, April 29th
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.Join us!
|Play for Me, Jarvis||Apr 16, 2015|
|Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites||Apr 15, 2015|
|Non-Linux FOSS: .NET?||Apr 13, 2015|
|Designing Foils with XFLR5||Apr 08, 2015|
|diff -u: What's New in Kernel Development||Apr 07, 2015|
- Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites
- Play for Me, Jarvis
- Non-Linux FOSS: .NET?
- Designing Foils with XFLR5
- Not So Dynamic Updates
- Flexible Access Control with Squid Proxy
- New Products
- Users, Permissions and Multitenant Sites
- diff -u: What's New in Kernel Development