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

Recruit two powerful-sounding students t...
I am a fan of anime, and I hear about a lot that comes through, but one that escaped my attention until now is A Certain Scientific Railgun T, and that name is very enticing. If it's new to you too, then players of Blue Archive can get a hands-on... | Read more »
Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
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 »

Price Scanner via MacPrices.net

May 2024 Apple Education discounts on MacBook...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take up to $300 off the purchase of a new MacBook... Read more
Clearance 16-inch M2 Pro MacBook Pros in stoc...
Apple has clearance 16″ M2 Pro MacBook Pros available in their Certified Refurbished store starting at $2049 and ranging up to $450 off original MSRP. Each model features a new outer case, shipping... Read more
Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
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 currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more

Jobs Board

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
*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.