Sub table insert feature

@patrick @George @Teodor

The form repeat for handling sub tables is a great new feature…finally tried it out today and it works great!
Thanks for easing nested tables. I don’t use db manager, and it still worked perfectly.

One hiccup I ran into…I had in my form a field with an empty name attribute. The insert of the sub table failed as it was attempting to insert into a column “0”. I just disabled the input so it would not be sent, but maybe you’ll want to handle this to prevent confusion.

{"status":"500","code":"ER_BAD_FIELD_ERROR","message":"insert into `quote_details` (`0`, `cost`, `currency_id`, `description`, `margin`, `quote_id`, `type`) values ('124', '123', '1', 'asdf', '1', 9, 'type1') - ER_BAD_FIELD_ERROR: Unknown column '0' in 'field list'","stack":"Error: ER_BAD_FIELD_ERROR: Unknown column '0' in 'field list'\n    at Query.Sequence._packetToError (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)\n    at Query.ErrorPacket (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)\n    at Protocol._parsePacket (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/Protocol.js:291:23)\n    at Parser._parsePacket (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/Parser.js:433:10)\n    at Parser.write (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/Parser.js:43:10)\n    at Protocol.write (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/Protocol.js:38:16)\n    at Socket.<anonymous> (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/Connection.js:88:28)\n    at Socket.<anonymous> (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/Connection.js:526:10)\n    at Socket.emit (events.js:315:20)\n    at addChunk (internal/streams/readable.js:309:12)\n    --------------------\n    at Protocol._enqueue (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/protocol/Protocol.js:144:48)\n    at Connection.query (/Users/pauka/WapplerProjects/cf/node_modules/mysql/lib/Connection.js:198:25)\n    at /Users/pauka/WapplerProjects/cf/node_modules/knex/lib/dialects/mysql/index.js:132:18\n    at new Promise (<anonymous>)\n    at Client_MySQL._query (/Users/pauka/WapplerProjects/cf/node_modules/knex/lib/dialects/mysql/index.js:126:12)\n    at executeQuery (/Users/pauka/WapplerProjects/cf/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)\n    at Client_MySQL.query (/Users/pauka/WapplerProjects/cf/node_modules/knex/lib/client.js:144:12)\n    at /Users/pauka/WapplerProjects/cf/node_modules/knex/lib/execution/transaction.js:363:24\n    at new Promise (<anonymous>)\n    at Client_MySQL.trxClient.query (/Users/pauka/WapplerProjects/cf/node_modules/knex/lib/execution/transaction.js:358:12)"}

Yes the sub tables and nested queries, as well nested updates are very powerful new features!

Database manager makes the usage of sub tables and nested structures even more easier with automatic nesting and relational keys creation. And indeed it picks up the existing database schemas and sub tables just as good, even if created with other tools.