• Home
  • Most Popular
  • Submit
  • About Us
  • Contact Us

Softpile

Free Downloads

Categories
  • Home
  • Most Popular
  • Communications
  • Desktop
  • Games & Entertainment
  • Graphic Apps
  • Network & Internet
  • Security & Privacy
  • System Utilities
Alternative to itextsharp 2022.11.10347
IronPDF offers an itextsharp alternative for HTML to PDF conversion with C# code examples, documentation, and ...
VShell Server for Linux and Mac 4.8
VShell is a versatile and secure file transfer server that supports multiple protocols and is compatible ...
PDF Studio PDF Editor for Linux 2022
PDF Studio is a cost-effective PDF editor that delivers full compatibility with the PDF Standard. It's ...
VQ Probe for Linux 1.5
VQ Probe is a comprehensive software tool that enables objective and subjective video quality analysis. The ...
Resilient Server 2.3
This Debian GNU/Linux (Buster) based software has a customized partitioning scheme that enhances robustness against filesystem ...
Valentina Studio for Linux 9.6
Valentina Studio is a cross-platform GUI manager for Mac, Windows, and Linux. It allows users to ...
VPN Lifeguard for Linux 1.0.58
The software monitors VPN connection and automatically terminates apps during connection loss, re-establishes the connection and ...
G_Viewer 0.84
G_Viewer is a Linux software that serves as both a file system and photo/image viewer. It ...
Checksome File Hash Tool for Linux 1.1
This software allows for the generation and verification of file hashes. It is a quick and ...
KeyWrangler Password Manager for Linux 1.2
A password management software that is secure, offline and extensible. It offers military-grade encryption to protect ...
Home Linux er2code Download

er2code

February 23, 2007
er2code simplifies database access for programming by auto-generating code. It is a useful tool in software development for developers who want to make accessing databases quick and easy.
License GPL
Platform Linux
Supported Languages English
Homepage halfdans.net
Developed by Rasmus Toftdahl Olesen
Er2code is a fantastic tool that can help programmers generate code to access databases from their programs automatically. This script takes in a database description file as input and generates a folder full of database wrapper files. The code generated is based on an XML file, and it is neutral in terms of both language and database. However, the tool supports only PHP with a MySQL database at the moment.

If you are using Python for your application, SQLObject is an excellent alternative to er2code. It is much cleaner and works with all kinds of databases. The idea behind the er2code project was to ease the burden on programmers by automating the process of writing boring and tedious database wrappers. Such tasks can lead to many errors that result from sleeping while typing.

The primary approach taken by er2code is mapping every relation or table of the database to a class of the same name, which contains functions for manipulating the attributes in the relation. The er2code script has a long list of “Functions” containing specific attribute requirements that, when satisfied, generate code. These functions contain plain text that, when combined with identifiers, generate a unique text string value for each attribute.

However, it is not as simple as that since concepts such as constructs, handling foreign relations like one-to-many, and deleting rows from tables must also be considered. The struct block layout of the file in er2code is somewhat similar to C structs and SQL. Every relation has its struct block defined such as:

User {
... attributes go here ...
}

In the above statement, when the er2code script is executed, it creates a User class, and any attribute defined within that relation is identified by the attribute's name, followed by one or more whitespace-separated attribute type definers and terminated by a semicolon.

For example, if the following attribute description is defined under the User relation:

User {
id serial;
username string(30) default(noname) sort unique index;
password string(40);
email string(100);
}

Users will have four attributes: id, username, password, and email. The id attribute is automatically incremented integer and defined as a primary key. The username attribute is a 30-character string, defined as sort, meaning that the result when the users list method is called should be sorted based on this attribute. It is also of type index, which means it should be possible to find users according to the value of this attribute. The password attribute is a 40-character string, and the email attribute is a 100-character string.

Using the above user attribute descriptions with er2code to generate PHP code should produce the following code:

// Connect to the database.
$db = new DataBase ();

// Find and print the User with the username halfdan.
$halfdan = $db->findUserByUsername( 'halfdan' );
if ($halfdan != null ) {
print $halfdan->getUsername() . ' ';
}

// List users sorted by username.
foreach ( $db->listUser() as $user ) {
print '' . $user->getName() . '';
}

Overall, er2code is an efficient tool that can automate tedious database wrapper writing. The program can be improved to be more versatile by adding support for other programming languages and database types, as its current support is limited to PHP MySQL combination.
What's New
Free Download
355
  • Share on:

Most Popular

  1. Quicksilver Forums 1.4.2
    157
  2. Dvgrab 3.4
    94
  3. DynVPN 1.0
    83
  4. CherryTV 0.1
    81
  5. SlideMap 1.2.2
    76
  6. porm r2
    72
  7. Clewarecontrol 0.8
    71
  8. Hills 2.0
    71
  9. fuseftp 0.8
    70
  10. Java Games 1.0
    70

Related Downloads

PenguinTV
PenguinTV is an eyeOS channel dedicated to delivering content from PenguinTV.
Smarty PHP template engine
Smarty is a PHP template engine that simplifies the process of designing ...
GINS
GINS is a software tool that enables adding GTK interfaces to GTK-free ...
TkMAME
TkMAME software is a graphical interface for XMAME developed with Tcl/Tk. It ...
Igelle Connector
This software is a network management tool that is specifically designed for ...
XBL Status
XBL Status provides the ability to monitor your Xbox Live friends list.
FreeDup
Freedup scans and navigates through selected directories to provide a comprehensive overview ...
weightbot
This software provides an unauthorized application programming interface (API) for WeightBot.com.
Cajun
Cajun software transforms any computer into a car audio device. It provides ...
Carp::Notify
A software tool that facilitates complaining about malfunctioning products or services across ...
Copyright © 1999-2025 Softpile Free Downloads
  • Most Popular
  • Submit
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Terms of Use

Can we use your data to tailor ads for you?

Our partners will collect data and use cookies for ad personalization and measurement.

By choosing "I agree", closing this pop-up or clicking on any element on the page, you agree to the use of cookies to help us provide you with a better user experience.

Learn how Softpile and our partners collect and use data.

You can change your choice at any time in our privacy center.

Cookie Settings

Our website stores four types of cookies. At any time you can choose which cookies you accept and which you refuse. You can read more about what cookies are and what types of cookies we store in our Cookie Policy.

are necessary for technical reasons. Without them, this website may not function properly.

are necessary for specific functionality on the website. Without them, some features may be disabled.

allow us to analyse website use and to improve the visitor's experience.

allow us to personalise your experience and to send you relevant content and offers, on this website and other websites.