• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding a new key to an existing table
I need to add a new key to an existing table.

1 - I tried to use the Add Key button in the Manager. I am able to add the name of the key but cannot find the way to save this new key so I could enter data into it after. Is there a button or a procedure I can use ?

2 - I tried adding a key with the code I found in you documentation using this code:
command cdb_addKeys pTable, pKeys

on mouseUp pButtonNumber

local tTable, tKeys

put "Subject" into tTable

put "Why" into tKeys

cdb_addKeys tTable,tKeys
end mouseUp

 I get the following message in the message Windows:
(2019-06-10 20:50:24.543): Error: Failed API Key Authentication

So I checked for A way to log as Developper or Administrator, but I found code that uses "user" but does not tell me with what to replace "user" whit to identify myself as Administrator.

on preOpenStack


    get cdb_auth(pEmail,pPassword,"user")
end preOpenStack

So What is the way to identify myself as Administrator so I can pass a command to add a new Key ?

Hi Jean,

"Users" are not allowed to add keys to tables. We will be improving our UAC so developers can customize what a user can do. If you are ok with your users having full access to your data model (delete project, delete tables, delete keys, add keys, etc) then you can call cdb_auth with "developer" instead of "user". pEmail and pPassword would be the email and password you use to login on LCM. If you don't want your users to have access to those APIs, then you can create a schemaless table. Users will be able to create records in a schemaless table with any key without having to add the key to the table.

Hope this helps!
I just tried using "developer" to add a key and it work fine. Merci, It's mean I can correct my table design and more tests.

Forum Jump:

Users browsing this thread: 1 Guest(s)