In progress - Dan I. [The original version of this demo was deisgned and written by Fabian Bornhofen and Lauritz Thamsen.  Hopefully they will fix any inaccuracies in my reconstruction of their logic] [Fabian]Right now (2012-06-06), if you want to use these components, you will have to use the lkcodesrv server for Node.js. It will only work with Node.js 4.x and SQLite. I will be happy to help porting it to a better server (https://github.com/fbornhofen/life_star).[/Fabian] The beginning concept in this demo is to be able to assemble a piece of data (think of it as a JS object or a row of a database) by dropping typed fields (BooleanInput, FloatInput, etc) onto a form (a DataForm). Next, a dataForm can be dropped on a DatabaseConnector, which causes the new data to be stored as a row in a table of the database.  If no table exists, it will be created, if that row does not exist it will be created (and given an id), and if the row already exists it will be updated.  This save/update can be done by using a button on the form, as well as by dropping it on the databaseConnector. [Fabian] When you drop the first row object into the database, the input form will be serialized into the database as well. When you then use DataSelector to browse that table, you can add new rows or change existing ones using the same form you created the table with. [/Fabian] Once a table exists in the database, it can be viewed as a table, and a given row can be selected and viewed as a dataForm (ie a row object or view on a JS object). ============ FAQ: [Fabian] How to create a DatabaseConnector on a known database: ------------------------------------------------------ Right now, the DatabaseConnector only works when configured to talk to a Node.js server: https://github.com/fbornhofen/lkcodesrv that is hooked up to an SQLite database. How to list the tables of the database: --------------------------------------- This is not supported yet. How to open a table view on a given table: ------------------------------------------ Pull out the DataSelector from the PartsBin and type in the table name. How to use cross-table references: ---------------------------------- If you want to use a foreign key in a DataForm, insert a DataReference input field and use the Morph menu to set its selector. The selector is a string 'TABLE_NAME:COLUMN_NAME'. TABLE_NAME is the table you are referring to. COLUMN_NAME is the name of a column in that table that is used to make the input field more readable. Instead of letting you choose from a list of IDs in the other table, you will see the value of that column. Depending on your schema, this could be more descriptive that the ID.
About DatabaseDemo
X
M