readTable() and the underlying table to edit

readTable() and the underlying table to edit

rldean1rldean1 Posts: 141Questions: 66Answers: 1

When using readTable() in the Node/Editor libraries, do the columns in the VIEW have to perfectly match the underlying table that is to be editied? I keep getting "Invalid column name..."

The VIEW doesn't have the all the same columns as the target edit table.

So like, the .readTable() is the my SQL View... but my .fields() point to the table I want to edit.

let editor = new Editor(db, 'OnboardingAppointments', 'ProcessingID')
.readTable('vueOA_Admin_Attendance')
.fields(...)

What if I had 3 different VIEWS? And, 1 table to edit?

I thought about using router.get() ... but, are the Editor/Node/Libraries aware that it should use router.get() after a CRUD operation? If not, how do we make it point to the appropriate api location after a CRUD operation?

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    do the columns in the VIEW have to perfectly match the underlying table that is to be editied? I keep getting "Invalid column name..."

    No - you can use the set() and get() methods to tell Editor to use fields only for one or other of the actions - e.g.:

    new Field('readFromView').set(false),
    new Field('writeToTable').get(false)
    

    Allan

This discussion has been closed.