TweetFollow Us on Twitter

dtF/SQL

Volume Number: 14 (1998)
Issue Number: 4
Column Tag: Tools Of The Trade

dtF/SQL -- The Little Engine That Could

by William A. Gilbert, Ph.D.

sLab makes there powerful SQL database engine available for anyone to use, at little or no cost

Introduction

File formats, saving data, relating fields, multiple files versus single file, backward compatibility... this is the struggle of all programmers with each new project. One could always use a third party database product such as FileMaker Pro or 4D but that only increases the complexity of development, deployment, and support. Another alternative is to use a centralized database system such as Sybase, Oracle, or Microsoft SQL Server, but often these solutions go beyond the scope of the project and introduce even more complexity and support problems.

Often what is needed is a small library which can store data, allow for the addition of new data definitions while being able to provide reasonable backward compatibility and to allow data protection from your competition. Yet at the same time it must allow access by those very special people -- the clients and customers!

Enter dtF/SQL, the little relational database engine that not only could but does achieve these goals and many others. dtF/SQL, a relational database engine for Mac OS, Windows 95/NT, and several Unix platforms from sLAB http://www.slab.com/, is provided as a small (403 Kbytes) linkable library which provides pure performance and pure pleasure for any developer who requires data storage in a file.

Having worked extensively with large scale SQL databases I had always wanted a product such as dtF/SQL for the "little" projects. With this library linked directly into my application, I can store both data and program parameters, access that data using simple or complex queries, and extend the data format by either adding additional fields to an existing table or by creating new tables. Using Finder file type and creator signature tags I can create double-clickable documents which launch the appropriate application under the Finder, as well as create custom icons for these documents. And the best part... it's free to non-commercial users and has reasonable licensing for commercial use. This is explained comprehensively at their web site.

dtF/SQL implements an impressive set of ANSI SQL functionality. It also supports the BLOB data type which is an arbitrarily large binary stream of data such as an image or a numeric array of data values. Both local and remote retrieval is fast. This subjective statement is based on experience with other database engines as well as experience with reading and parsing other file formats.

Hiding Complexity

Our goal as programmers is to provide our clients and customers with a product which performs both to specifications and expectations, but is also easy to use. Grady Booch has put it well: "The task of the software development team is to engineer the illusion of simplicity." This statement is particularly true for Macintosh applications, where end users have come to expect an environment in which one copies the application with some documents from the distribution disk and just expects to double-click a document and go. Using the dtF/SQL engine there are no extensions to load and configure, there is no restarting the computer, and there is no performance overhead imposed by switching processes or drivers. Additionally, there is no middleware to install with additional royalties. The bottom line is that the developer is able to deploy self-contained double-clickable database applications and documents, runnable even directly from a CD-ROM.

One Programmer's experience

I found the dtF/SQL API definitions and documentation, provided in PDF format, to be very readable. There are over 400 pages which describe the installation, data types, high level API, and low level API. Each API has a usage example as well as any restriction or limitation of the API.

The Macintosh distribution comes with the application, dtF/Admin, which allows one to create and experiment with a database to see the effects of SQL queries. This tool is a great way for beginners to learn how to create database schema or test SQL queries on real data before committing these queries to source code. If you mess up the database, just throw it in the trash and start over; you won't have an enraged database administrator breathing down your cubicle. The dtF/Admin application allows you to save scripts so that the database can be recreated and repopulated in seconds.

Of course, this can be done under program control as well. I keep my database schema scripts as STR# resources, then, with a New command, a new database can be created anytime.

At first I was disappointed that I couldn't write the equivalent of Sybase stored procedures to facilitate queries. I then realized that I was equally well off not being able to write and invoke stored procedures, because I was able to implement these procedures as C or C++ routines. I found that where I had become accustomed to writing complex SQL select statements with extensive join clauses, I could, with dtF/SQL, create a couple of separate workspaces, then use nested for loops to perform the same queries in a faster, much more logical fashion.

For those of you not familiar with SQL, the implications of this are significant. The SQL join command to resolve relationships takes lots of memory. In contrast, successive select statements which use the results of one SQL statement as input to the next SQL select statement takes almost no memory at all and with dtF/SQL is probably faster than doing the original join. The bottom line here is that one does not have to become an SQL guru to use dtF/SQL effectively. Arguably, such expertise may even work against you. The web-based, downloadable distribution comes with several complete, non-trivial example programs which demonstrate the usage of almost all of the APIs.

If Only...

dtF/SQL's implementation departs from the Macintosh application & document paradigm in one respect. In release 1.6 the database is actually two files, a database file and a separate file used to store BLOB data. This can present some challenges to the double-clickable document interface. The application must determine the location of the other file and then open it. For situations where a BLOB file is not required, an empty BLOB file can be created on the fly and opened, then deleted when the database session is over. If a BLOB file is required, one can use a Windows and Unix trick and require that the data file and BLOB file have the same name but require that the BLOB file end with the word "BLOB". Not truly the Macintosh way of doing things, but it works well enough.

The requirement of a separate BLOB file will be removed in release 1.8 which is expect to be available in early 1998. Then BLOB data will stored with all other data in the single file.

Availability

The dtF/SQL object library is available for Macintosh System 7.x and Mac OS 8 (68K and native PowerPC). MPW C/C++ , Symantec C/C++ and CodeWarrior C/C++ are supported. Separate versions for HyperCard, SuperCard, AppleScript, MacHTTP CGI, Smalltalk Agents and other environments are available. dtF/SQL also is an integral component of the Internet-enabled client/server development system from Pictorius, Inc. and the Oberon/F-based client/server system from microsystems. The dtF/SQL engine is also available for DOS, Win16, Win32, NT, OS/2, SUN OS, HP/UX and Linux. You must purchase support separately. It is provided by e-mail and is timely and informative.

The documentation is supplied as PDF files which can be read with Adobe Acrobat. I would have preferred hard copy, especially for the API definitions when first learning the library. On the other hand, these APIs are few and are learned quickly. The code examples are excellent and non-trivial. There also are some third party examples which range from to obvious to obfuscated.

The CodeWarrior CD-ROM distribution contains a demo version of this product, dtF Lite, as well as some experimental PowerPlant classes which encapsulate the dtF/SQL API. The standalone database tool, dtF/Admin, also is provided and is very useful of anyone who wants to learn more about relational databases and the SQL syntax in general

The database and BLOB files are binary compatible between Macintosh, PC, and Unix platforms, making the dtF/SQL engine and database files a perfect candidate for distribution on CD-ROM.

There are ODBC drivers for dtF/SQL for Win16 and Win32; Macintosh ODBC drivers will be ported shortly. Support for Java JDBC is under development and should be part of the upcoming version 1.7 release.

Scalability

Once you have deployed your application, your users may come back and ask about scaling up so that the members of their organizations can use your application to examine and modify shared data. Does this mean that you will have scrap your work and learn to use Sybase, Oracle, or ODBC libraries? No! dtF/SQL is available in a client/server configuration; so, as a developer, you add a few lines of connection code and relink your existing source with the dtF client library. Your customer purchases and runs the dtF/SQL server for their database files (licensed separately from sLAB, downloaded from the web with a password). They can now use your newly relinked application, with its familiar UI, to access and share their data. The dtF/SQL LAN server runs on Macintosh, Windows 95/NT, and some Unix platforms. Version 1.7 will allow any dtF/SQL client to connect to any dtF/SQL server.

Recommendation

I can unconditionally recommend the dtF library to any programmer who wants to develop and deploy solutions which deliver performance and simplicity to the customer. As for robustness, let me add in conclusion that I have crashed about a thousand times during development and have never had a dtF/SQL database file become corrupt as a result.

Pricing

All single user non-commercial dtF/SQL products are free and can be downloaded from the web, including documentation. There are no restrictions such as time-outs or maximum record sizes with the downloaded product. Non-commercial uses of the engine are also free. Distribution of commercial products are priced on a unit basis. Large volume pricing can bring the price down to 1 DM (about $0.65 US) per unit. For server pricing contact sLAB directly by e-mail or phone, available from their web site.

Useful URL's

http://www.slab.de/uk/homepage/index.html is sLab's home page, in English. All dtF products, commercial and non-commercial, are available from this site.


Editor's Note

sLab has made an astonishing offer to the programming community at large - a free, high end SQL relational database for non-commercial use. After I read this review, I trotted over to their home page and downloaded all the stuff I needed to look at this product. As Dr. Gilbert indicates, this is a super package. This is a great opportunity to learn and have fun with no investment, and presumably sLab will reap the appropriate benefits when we all write our killer apps based on their libraries.

I had never dubbed around with an SQL-based package before, and asked Will to recommend an introduction to the language. The book he recommended is quite readable and informative. It's only shortcoming is that the accompanying CD is Windows only, but many of us now have a Wintel machine or an emulator program, and I won't tell anyone if you won't. ;-)

The Practical SQL Handbook, third ed., 1996, by Bowman, Emerson, and Darnovsky. Addison Wesley Developers Press, Reading MA. ISBN 0-201-44787-8.

-Ed Ringel


William Gilbert, http://www.informagen.com/cv/Gilbert.html, is a biochemist by training as well as a computer professional. He provides informatics solutions and scientific consulting to startup biotechnology companies. He also holds a research professorship at the University of New Hampshire in the Department of Biochemistry and Molecular Biology.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »

Price Scanner via MacPrices.net

Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more
You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more
Sunday Sale: 13-inch M3 MacBook Air for $999,...
Several Apple retailers have the new 13″ MacBook Air with an M3 CPU in stock and on sale today for only $999 in Midnight. These are the lowest prices currently available for new 13″ M3 MacBook Airs... Read more
Multiple Apple retailers are offering 13-inch...
Several Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices... Read more

Jobs Board

Relationship Banker - *Apple* Valley Financ...
Relationship Banker - Apple Valley Financial Center APPLE VALLEY, Minnesota **Job Description:** At Bank of America, we are guided by a common purpose to help Read more
IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: Apr 9, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 824398 At Target Optical, we help people see and look great - and Read more
Medical Assistant - Orthopedics *Apple* Hil...
Medical Assistant - Orthopedics Apple Hill York Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.