Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.619.537 Times

ZDB 0.1

  Date Added: July 01, 2010  |  Visits: 799


Report Broken Link
Printer Friendly Version

Product Homepage
Download (83 downloads)

ZDB ( DataBase) can be used to maintain simple lists and databases (such as telephone directories, address lists, etc). The project implements mechanisms for basic queries and reporting, and also allows us to join two tables by a primary key, and display query results based thereon. ZDB is not a relational database. If you want a relational DB then use a proper DBMS! ZDB is, however, highly useful for small, non-critical database needs, especially where "flat-files" are all thats really required, but where maintaining a long list of data manually would be too labour intensive. ZDB requires the "usual-suspects" with regards to tool dependencies. All of the required tools will be present in any modern UNIX/Linux system. The scripts are implemented as bash scripts, but if you change the shebang line to match the path to your shell, and as long as your shell supports the ((...)) arithmetic construct, youll be okay! There arent any bash-specifics in the scripts. Some of the scripts (especially query scripts) may run fairly slowly depending on your system. There is a lot of data processing going on in the background (involving many invocations of awk!). On a P4 2.66GHz the results will be instantaneous, whereas on a PII 233MHz you might not be so lucky. Package Contents The ZDB package consists of the following scripts: zdb_constants Contains constants needed by all scripts zdb_create_table Creates a new table zdb_insert_values Insert values into a table zdb_join_tables Query two tables using a join zdb_remove_table Drop a table zdb_remove_values Remove values from a table zdb_select_all Display an entire table zdb_select_rows Query a table by row zdb_select_values Query a table by column name zdb_get_by_key Get a single row by its key value Also included in the download is zdb_test which is an example showing how each of the commands is used, creating tables, inserting values, querying the tables, and finally deleting the tables. As you can see, I havent implemented a "change row" script. I dont see the point, as it would just duplicate the functionality of a call to zdb_remove_values followed by a call to zdb_insert_values. I have shown an example of this in the zdb_test script, included with the download. Overview of Data Structure Each table is made of two parts. A .def (Definition) file, and a .dat (Data) file. The .def file is created when the table is first created, and contains a list of all the column names in that table, and thus, provides that tables definition. The .dat file is created when the first row of values is inserted (and is deleted when the last row of data is removed). This is a flat file using ":" as a column delimeter. Therefore, do NOT use ":" in any of your data! The idea of the .def file is to provide column name to field position translation, so that we can query in the form column_name=value (kind of like a WHERE clause in SQL). They are saved as table_name.{dat,def} in the directory specified by the ZDB_DIR constant (see below). The first (left-most) column in each table is considered to be its key and must be unique for each row in the table. Syntax The syntax of each command is discussed below. zdb_constants Syntax N/A In the current implementation, this script contains only one constant, ZDB_DIR, which is the full path to the directory containing your database (.dat/.def) files. It is important that the directory exists, and that this constant is set correctly to reference the directories path, otherwise nothing will work! Example ZDB_DIR=/home/kevin/databases/db_one zdb_create_table Syntax zdb_create_table table_name col_1 [ col_2 ... col_n ] Create a table within ZDB_DIR named table_name as specified by the first argument to the command. The column names are specified by subsequent arguments to the command. At least one column must be specified. This command creates a file in ZDB_DIR named table_name.def. Example zdb_create_table my_table id f_name s_name t_name zdb_insert_values Syntax zdb_insert_values table_name val_1 [ val_2 ... val_n ] Insert values specified by val_1, etc, into table_name. This has various error checking mechanisms implemented, and will check for the correct number of values (i.e. the same number of values as there are columns in the table). val_1 in the left-most column is considered to be a primary key for that row of data, and must be unique within that table. Values are added sequentially, and are thus "appended" to the table in the order that they are added. No sorting takes place. If any single value contains spaces, it must be quoted, e.g. "example value with spaces". Example zdb_insert_values my_table 1 Kevin Waldron 0208-111-1111 zdb_join_tables Syntax zdb_join_tables table_one table_two [ searchterm | col=searchterm ] Join two tables by their key field, and print fields from both tables where the row key matches. Other rows are not printed. An optional searchterm can be specified. This searchterm MUST be a single word, and can be of the form "searchterm" where all fields are searched, or "col=searchterm" whereby only the specified column name "col" is searched. Example Suppose we have two tables populated with data, the following session depicts command usage and possible output $ zdb_join_tables my_info my_table name=Kevin id name number data_1 data_2 1 Kevin Smith 02081111234 zdb_data more_data 2 Kevin Jones 02078392111 data_value more_data 68 Mr Kevin 9230192912 0291 19192 zdb_remove_table Syntax zdb_remove_table table_name If table_name exists, both its .def and .dat files will be deleted. Example zdb_remove_table my_table zdb_remove_values Syntax zdb_remove_values table_name key Removes the row from table_name specified by key, where key is the unique identifier for that row (the entry in the first column of the table for that row). Example To remove the row with key "4" from my_table zdb_remove_values my_table 4 zdb_select_all Syntax zdb_select_all table_name Displays all data from table_name preceeded by a header row detailing the column names Example zdb_select_all my_table zdb_select_rows Syntax zdb_select_rows table_name searchterm|col=searchterm Shows all rows from table_name where searchterm can be found. Accepts both forms of searchterm specification, as discussed in the zdb_join_tables section above. Example zdb_select_rows my_table Kevin zdb_select_values Syntax zdb_select_values table_name col_1 [ col_2 ... col_n ] Selects and displays all data from the specified columns in table_name Example Yes, multiple instances of the same column can be specified, to repeat their output zdb_select_values my_table f_name f_name s_name zdb_get_by_key Syntax zdb_get_by_key table_name key Select only the single row from table_name that has the unique key key. Example zdb_get_by_key my_table 1.

Requirements: No special requirements
Platforms: Linux
Keyword: Data Database Key Must Be Name Row Simple Lists Such As Table Telephone Directories Two Tables Used To Values Zazzybob Com Database Zdb
Users rating: 0/10

License: Freeware Size: 6.14 KB
More Reviews or Write Review

Network & Internet  -  DataReel 4.30
Datareel project is a comprehensive development kit used to build multi-threaded database and communication applications. C++ is a programming language that produces fast executing compiled programs and offers very powerful programming...
1.4 MB  
Database Tools  -  Simple MySQL dump 1.0
Simple MySQL dump can be used to dump a MySQL database as a list of SQL statements. It can retrieve the database tables metadata and execute and SQL SELECT query to retrieve all the data of the tables to be dumped.Simple MySQL dump returns a...
10 KB  
Libraries  -  Basset::DB::Table 1.04
Basset::DB::Table is used to define database tables, ways to load that data into memory and build queries based upon the table information. SYNOPSIS For example, my $table = Basset::DB::Table->new( name => user, primary_column => id,...
143.36 KB  
Database Tools  -  DB Populator 1.0
This class can be used to populate a MySQL database with random data. It can scan the list of tables and fields of a MySQL database and generate SQL INSERT statements that will fill the tables with records with random data.The class tries to...
10 KB  
Database Tools  -  LSM Check and Repair 1.0
LSM Check and Repair can be used to access a MySQL database check its tables in order to perform tasks like repairing tables, recover lost indexes and table data files, taking backups and optimize the tables.LSM Check and Repair also generates a...
92.16 KB  
Database Tools  -  Database Functions 1.0
Database Functions is a PHP class that can be used to build and execute MySQL database queries. It can build SELECT, INSERT, UPDATE and DELETE queries from lists of parameters and values. The class can also execute the generated queries and...
Database Tools  -  SQL Query Builder 1.0
SQL Query Builder can be used to dynamically build SQL database queries.It provides functions for defining query parameters such as the query type, tables, columns, the clauses where, order by, group by and having, limit row range.SQL Query...
10 KB  
Development Tools  -  DB Backup Class 1.0
This class can be used to generate a MySQL database backup using PDO.It can query the structure of a given MySQL database and generate SQL statements to recreate and insert the records of the tables in the database.The resulting SQL statements are...
10 KB  
Database Tools  -  Visitation Model ADOdb 1.0
The class Visitation Model ADOdb can be used to manipulate and browse database table records structured as an hierarchy tree.Visitation Model ADOdb is based on another class originally developed by Khaled Al-Shamaa. It uses the ADOdb API instead...
10 KB  
Database Tools  -  MM::CMySQL 1.0
MM::CMySQL can be used to execute parameterized MySQL database queries. It is a concrete implementation of the CDatabase abstract base class that implements support for executing MySQL database queries and retrieve its results.MM::CMySQL also uses...
10 KB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Database Tools  -  mel, XML Data Binding for C 2
Language: C, XMLLibrary: libxml2OS: AnyXML Databinding for C similar to JAXB, including but not limited to:.dtd to .[ch] production..xsd to .[ch] production (in progress)
53.07 KB  
Database Tools  -  CitrusDB 1.1.4
CitrusDB is an open source customer database application that uses PHP and a database back-end (currently MySQL). This software can keep track of customer information, CRM, services, products, billing, and customer service information. The...
1.1 MB  
Database Tools  -  MyJgui
MyJgui is a light-weight graphical user interface for MySQL databases. It aims to be easy to use for new users as well as experts. Motivation: After the MySQL Front project went commercial, there was no light weight, feature rich and free...
21.5 KB  
Database Tools  -  PHPCoder 1.4
PHPCoder is a web based front-end to the Turck MMCache encoding functions, which are similar to the Zend Encoder product. Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases...
16.38 KB  
Database Tools  -  Rekall 2.2.6
Rekall is a database front-end, somewhat in the style of MicroSoft Access. However, Rekall is not itself a database, and does not include a database. By this we mean that data is stored somewhere else in an SQL server, and Rekall is fundementaly...
4.9 MB