Menu

#19 Automatic Database Validation

open
None
7
2008-07-24
2008-07-24
No

Generate additional code for automatic validation of a Database based on a given DataScript model.

Add a new interface to the runtime library:

package datascript.runtime;

public interface ValidationListener
{
void onError(String tableName, long primaryKey, Throwable t);
}

Generate a new method for each sql_database:

FooDatabase.validate(ValidationListener listener):

for each table instance
table.validate()

Generate a new method for each sql_table:

FooTable.validate(ValidationListener listener):

selects all rows from the table
for each row
for each BLOB column
find the corresponding DataScript type
decode the column with this type
on exception: notify listener

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.