Running Recital
$ recital $ recital --help $ man recital
Starting the Recital Server
# service recital start # service recital status # man recitalserver # man recitalweb
Recital Express Editions
New Cluster aware fault tolerant database engine
Recital SmartQuery
Database Timelines
Increased variable name length
Increased string length
Extended Text/Memo Editor
String functions with memos
Self healing indexes
Reduced memory footprint
Dynamically allocated workareas
Extended shorthand operators
Recital now supports shorthand operators on assignment statements.
+= | add right hand side expression to left hand side variable | var += 10 |
-= | subtract right hand side expression to left hand side variable | var += 10 |
*= | multiply right hand side expression by left hand side variable | var *= 10 |
/= | divide left hand side variable by right hand hand side expression | var /= 10 |
Static array initializers
Static arrays can now be created and populated using array constants.
private tab = { "hello", "world" } private tab2 = { { "hello", 10, date()}, {"world", 20, date()} } myfunc( { 10,20,30,40 } )
Improved data type checking
By default, Recital is a loosely typed language. When SET STRICT is ON, this disables assignments to variables that have not been declared before use. Additionally type checking is in effect when assignments are made.
private nvar as numeric private cvar as character private dvar as date private tvar as datetime private yvar as currency private lvar as logical private avar as array private ovar as object private ovar as classname nvar = 10 // ok nvar = "" // error invalid assignment
Initialize variables at declaration time to improve readability
private title = "The application title" private count = 0 // type check them at runtime too private title as character = "The application title" private count as numeric = 0
Database Administration Tools
Recital 10 includes a collection of Database Administration Tools (DAT) that can be used in shell scripts. The DAT are executed using the recitaladmin command from a shell.
- recitaladmin shutdown
- recitaladmin startup
- recitaladmin disable
- recitaladmin enable
- recitaladmin backup
- recitaladmin restore
- recitaladmin integrity
- recitaladmin suspend
- recitaladmin resume
- recitaladmin start
- recitaladmin stop
- recitaladmin restart
- recitaladmin logoff
- recitaladmin broadcast
- recitaladmin --help
Suspend and Resume of Recital
# service recital suspend # echo perform the backup... # service recital resume
If you need to handle suspend and resume specifically in your application you can do so using the following new features in Recital 10.
on signal 50 do your_suspend_proc on signal 51 do your_resume_proc
Then use the "service recital suspend" and "service recital resume" commands. Alternatively send signals using the "kill" command.
kill -50 pid# suspend kill -51 pid# resume
Improved compiler
Additionally, you can compile your programs in debug mode. Programs that have been compiled in debug mode will provide statement profiling information in the debug.txt file if SET DEBUG ON is in effect when the program is executed. You compile in debug mode using the compile command.
compile filename debug
New database integrity verification tool
# recitalintegrity --help recitalintegrity - Recital database integrity verification tool usage: recitalintegrity [options] Options: -f table table to verify -d directory directory to verify -D database database to verify -r recursively process subdirectories -y repair data if errors -q Only display errors -a verbose mode --help, -h Display this information
Major performance improvements
- Symbol table hash table sizes
- Hashing algorithm used for symbol lookup
- All objects, dynarrays and arrays are now passed by reference. They can be returned from procedures/functions even if declared private inside the called procedure
- Objects, dynarrays and arrays are now reference counted (similar to java) and automatically released when they have no more references.
- The compiler code generation has been enhanced resulting is faster .dbo files with less memory consumption
- APPEND FROM now locks the complete table and appends in the new records which reduces record locks and is particularly noticeable on clustered/network file systems.
- General network I/O optimizations and improving performance of the REPLACE and SQL UPDATE statements.
- Major performance improvement on indexes with large numbers of duplicate keys
- Major performance improvements for network file systems and clusters.
- Improved compiler optimizations resulting in faster code
Code and data profiler
Using Recital with MySQL, Oracle, DB2, and Postgres
Enhanced object-oriented programming functionality
Recital is a dynamic programming language particularly suited to the development of database applications. While Recital still supports standard procedural programming, new extensions to the language give you the power and flexibility of object-oriented programming. Object-oriented design and object-oriented programming represent a change in focus from standard procedural programming. Prior to Recital 10 being released, object-oriented programming (OOP) support in Recital was somewhat limited. In Recital 10 the whole OOP engine has been overhauled and is now much more advanced and flexible. See this articlefor details.Enhanced Recital command window
- When using Recital in interactive mode, the command window has been enhanced. Pressing ^w pops up a textedit window which can be used for editing long commands (particularly useful for SQL commands).
- Pressing the Return key echoes it to the output window (useful for clearing text) when using interactive commands.
- Improved command history. When using the up-array and down-array keys from the keyboard to view and/or execute previous commands, duplicate commands are ignored.
- When developing/testing Recital program files from the interactive command window, if an error occurs you can edit the offending program by selecting 'edit' from the error dialog. The file will be opened at the offending line number.
- Command autocompletion using the TAB key
Program editor enhancements
Use Recital in shell scripts
Better Unix/Linux command line integration
echo "The default directory is `pwd`" echo "There are `ls -l *.dbf | wc -l` tables in this directory"
Automatic data type conversions in character expressions
When non-character data is added to strings, the data is automatically converted to a string similar to the etos() functions operates. SET STRICT OFF must be in effect to enable this.
echo "This string can add numerics and dates etc " + 100.89 + " " + date()
Conditional loading of shared libraries
Automatic loading of extension libraries
SQL performance improvements
- SQL SELECT improved query optimizer
- Handles index restriction using filtered indexes (INDEX ... FOR ... )
- Handles index restriction with > and >=
- Dramatic improvements to nested SELECT statements
- SmartQuery caching
SQL Select extensions
SELECT * FROM table INTO JSON
SELECT * FROM table INTO OBJECT
SELECT * FROM table INTO HTML
SELECT * FROM table INTO XML
New commands
COPY DATABASE TO [ IF [ NOT ] EXISTS ]
This command is used to copy an existing database to a new database. By default an error will be returned if the target database already exists. Specifing the optional IF NOT EXISTS keywords no error will be returned if the traget database already exists. If the optional IF EXISTS keywords are specfied and the target databases already exists, then it will be removed before the copy. Both the databases must be closed before they can be copied.
SET AUTOHEAL ON/OFF
Enables or disables auto-healing of indexes.
SET FSTATCACHE ON/OFF
Enables or disables caching of file information on a network file system.
SET TXLEVEL TO COMMITTED | UNCOMMITTED
Sets the transaction isolation level for SQL commands.
SET NETWORK ON/OFF
SET NETWORK TO
Enable or disables Recital Clustered File system support which provides superior performance on networked systems using glusterfs or samba.
SET TIMELINE ON/OFF
Enables or disables timelines for the active table.
CLEAR TIMELINE
Clears the timeline for all tables.
LIST TIMELINE [RANGE date [,date] [FOR condition]
Lists the timeline for all or selected tables over a datetime range.
ROLLBACK TIMELINE RANGE date [,date] [FOR condition]
Rolls back data to a previous timeline for all or selected tables over a datetime range.
SET TIMESTAMP TO
Enables a timestamp to be inserted into a field of a record as it is being appended into a table.
SET SMARTQUERY ON/OFF
SET SMARTQUERY TO
Enables or disable SmartQuery caching.
CLEAR SMARTQUERY
Clears the SmartQuery cache for all tables.
EXPLAIN
Explains the execution of a SQL SELECT statement and provides details of how the query is being processed.
FOREACH
Provides a convenient way to iterate over elements in associative or static arrays.
ECHO
Similar to the existing ? command but the string output can contain C-style escaped characters e.g. "\n" and php-style $variable and {expression} substitutions in character strings.
OPTIMIZE
This new command is used to optimize a table by it's primary key. The table is physically ordered by the specified primary key to give better performance when reading rows from the table. If the optional PACK keyword is specified then deleted rows are removed from the table during the optimization process. The optional ALL keyword can be specified to optimize all open tables or the optional DATABASE key word can used to optimize all tables in a specified database. The table being optimized must have a primary key.
SET DATADIR TO [directory]
This new command is used to specify a directory where database tables, memos, indexes, and dictionary files are located. When a table is being opened this directory is searched first before the current directory and the file search path to locate the table and its associated files. This allows the database tables to be relocated to a different file system without the need to change an existing application.
SET DATE TO ISO
Recital now supports SET DATE TO ISO which will set date to a YYYY-MM-DD format. International Standard ISO 8601 specifies numeric representations of date and time. This standard notation helps to avoid confusion in international communication caused by the many different national notations and increases the portability of computer user interfaces. In addition, these formats have several important advantages for computer usage compared to other traditional date and time notations.
Enhancements to existing commands
COPY TYPE CSV
Copies to a csv file
New functions
numeric = xml_gather( xmlstring as character )
numeric = mqcurmsgs(mqdes as numeric)
( use fputs(), fgets(), fflush(), fread(), fclose() with this function )
Returns the current transaction isolation level
character = txlevel()
Fills an array with elements of a string separated by newline (default)
numeric = alines(arrayname, string as character [,flags as numeric [, separator as character] ] )
Returns a string describing the last operating system error message. If the optional error number is
specified then the related operating system error message will be returned.
character = strerror( [ errno as numeric ] )
Returns all the fields in the current row as a string. The string will begin with the uniquied row identifier and then the deleted flag, followed by the data in the record. An optional workarea can be specified, otherwise the current workarea will be used.
character = rtos( [workarea as numeric] )
Returns true if the session is running from a terminal (not a batch job)
logical = isatty()
Returns information showing who has a file open and whether it is exclusive or shared.
character = lockinfo(filename as character)
New functions to handle ini / configuration files
Sets a key/value pair in a section of an ini/configuration file
ini_set(Section as character, Key as character, Value as character[, Filename as character]) as logical
Gets a value for a key in a section of an ini/configuration file
ini_get( Section as character, Key as character[[[, Default as character], Filename as character], Macros as logical]) as character
Sets all key/value pairs for a section of an ini/configuration file
ini_setsection(object as object, Section as character[, Filename as character]) as logical
Gets all key/value pairs for a section of an ini/configuration file
ini_getsection(Section as character[[, Filename as character], Macros as logical]) as object
A typical ini/configuration file looks like this:
# comment lines are preceeded by a '#' ; or a ';' # # "Sections" are enclosed in [ and ] [global] ; key/value pairs are contained in the sections and are written like this key1 = value key2 = value2 ; You can include macros in the key/value pairs. key3 = This is $(key2) and $(key1)Notes:
- If "Filename" is not specified then it will default to the recital system configuration file /etc/recital.conf
- It "Macros" is not specified both ini_get( ) and ini_getsection( ) will not expand macros. Set it to true if you want macros expanded
- ini_getsection( ) returns a dynamic array which allows you to reference key/value pairs, update them, and write them back to the configuration file.
- You should set the file permissions on /etc/recital.conf to 755 to prevent changes to the recital system configuration file
New PHP-compatible functions to reduce learning curve for PHP developers
(Click here for function details and examples)
number = strcmp( expC1, expC2 )
number = strcasecmp( expC1, expC2 )
number = strpos( expC1, expC2 )
logical = in_array( expC, expA )
character = strstr( expC1, expC2 )
number = strlen( expC1 )
unset( variable )
isset( variable )
die( exp )
exit( exp )
object = array( )
character = base64_encode( expC )
character = base64_decode( expC )
number = filesize( expC )
logical = function_exists( expC )
print_r( expO )
character = str_replace( needle, replace, haystack )
character = strtolower( expC )
character = strtoupper( expC )
character = ucfirst( expC )
character = str_pad( expC, expN [, expC] )
character = html_entities( expC )
character = html_entity_decode( expC )
require( Filename )
require_once( Filename )
include( Filename )
include_once( Filename )
character = strftime( format [, datetime ])
Determine if a variable is of a specific type
logical = is_array( exp )
logical = is_object( exp )
logical = is_string( exp )
logical = is_int( exp )
logical = is_float( exp )
Wraps a string to given line width (defaults to 80)
character = wordwrap( character string [, numeric line_length [, character break_char [, logical cut ] ] ] )
The implode() function returns a string from the elements of an array
character = implode(separator as character, arrayname)
The explode() function breaks a string into an array
array = explode(separator as character, string as character)
Bug fixes
- Numerous bug fixes.
Deprecated features
The following features are no longer supported and have been removed from Recital 10
- The ASSIST command and the shell dba script
- The INFO command and the dbinfo script
- The DESIGN command and the dbdesign script
- SET MAXDBO command is ignored
- DB_MAXWKA environment variable in recital.conf is ignored
- shell commands dbc, dbvideo
- The Recital database library has been discontinued. The Recital/SDK C extensions API should be used instead.