Menu

fSQL v1.4 Beta Status Update

While fSQL v1.4 still lives in SVN and is unready for a stable release, there's lot of new features going in. And I just coming up with more to fit in, which keeps pushing back the schedule. The latest is a very big rearchitecture that affects everything. But you still probably wouldn't notice unless I pointed it out.

New features:
1. In-memory databases
2. Schemas
3. System information database
Planned features:
1. Views
2. INFORMATION_SCHEMA
3. More SQL Standard features and types

In-memory databases are created when you specify the path in define_db() as ':memory:' to create a database purely in memory in which all tables are automatically temporary. This databses and all its contents are freed when the script ends or environment closes.

Having recently acquired a copy of the SQL 2008 Standard, there's one feature I really wanted to add and that is "schemas". Schemas are basically namespaces inside a database. According the standard, databases should not contain tables, only schemas should. fSQL had been following the following the mySQL example of a database which are basically schemas with no parents.

Now fSQL databases are been split into databases and schemas. Databases are still just directories. Schemas are stored as subdirectories in fSQL. And for backwards compatibility, we followed PostgreSQL's example and gave each database a "public" schema which is the default schema and stores it tables in the database's directory rather than a subdirectory. So all your pre-existing tables will continue to work normally because each of our old tables will be mapped into the public schemas with changing any of your code.

API changes:
- Changed define_db($db_name, $db_path) so that it automatically creates "public" schemas on database definition.
- Added define_schema($db_name, $schema_name) which adds a new schema of the specified name to the specified database which must already been defined using define_db().
- Changed select_db($db_name) so that it now sets the current database to the specified database and sets the current schema to that database's "public" schema.
- Added select_schema($db_name, $schema_name) sets the current database to the specified database and sets the current schema to that database's specified schema.
- When specifying table names in queries, you can use just "table" or "schema.table" or "database.schema.table" patterns. Any pre-existing references to other db tables like "database.table" must be changed to "database.public.table".

Also, I added a special in-memory database called "FSQL" which one schema called "master" which system information. Right now there are four tables inside called "databases", "schemas", "tables", and "columns" which contain metadata about the entire environment. Support for mySQL's SHOW and DESCRIBE will probably be deprecated and eventually removed in favor if these tables.

Also, I'm doing to add to squeeze "views" into this release, and if I do, support for the standard's INFORMATION_SCHEMA schema will be added which will be views mapping to the new FSQL.master data.

These new features are pretty recent and may have bugs but please try them out.

If you have any questions about these changes, you can ask at the forums here and if you find any bugs, please report them to the tracker.

PS. When v1.4 is nearly ready, I'll be updating the web site with the latest full docs as well.

Posted by Steven Buberl 2009-09-22

Log in to post a comment.