There is a database table containing metadata of new tables. For example:
- TableA: col_1 varchar(10), col_2 int
TableB: col_3 text, col_4 bytea
A Servoy form will list all tables, let a user pick which ones to create, provide a drop-down of databases to choose in which the tables will be created.
And then comes the hard part (I am new to Servoy).
I can generate SQL "CREATE TABLE" DDL statement but don't think it's the best solution because
a) DDL is database platform-specific and b) must synchronize structure of updated database with servoy.
After looking through manuals I found these functions:
- Code: Select all
var server = plugins.maintenance.getServer('test_db');
var table = server.createNewTable('new_table');
var pk = table.createNewColumn('new_table_id', JSColumn.INTEGER, 0);
...
which look good but work only in maintenance mode. I understand that it implies that it can not run from Web client.
What may you suggest?
Running DDL statements directly on DB then synchronising it with Servoy (and have to implement separate syntax specs for each platform)?
Use "createNewTable" from Web Client, if so, how?
Another solution?
Thanks