Appshet and MySQL Key Columns

Hello,

I have an App that it's connected to a MySQL database.

The way that the DB manager generates his keys for all his tables is through an integer column with auto increment.

Luis_DfG_0-1646799120362.png

I could try to calculate the next auto increment key value but I believe this will create conflics in the future (e.g. multiple users saving records at the same time).

However, I could be able to feed the column key through Appsheet, but we will have users also pouring information into the database through a web-app as well.

Under this scenario, is it possible for MySQL to generate a unique ID as Appsheet does?

If that is not possible, and the MySQL database must key the int + auto increment, shall we have two key columns? one used in the Appsheet environment and the other on the web-app environment?

Is there any other approach we could take?

Thanks in advance!

Solved Solved
0 3 345
1 ACCEPTED SOLUTION

In MySQL the equivalent function is called: UUID()

View solution in original post

3 REPLIES 3

Please take a look at the following article and the section  "Working with IDENTITY columns" . 

https://help.appsheet.com/en/articles/962066-using-data-from-mysql#working-with-special-characters

The recommendation in the article is, please create a NVARCHAR (8) type column as key and assign it as a key column. In AppSheet editor, assign UNIQUEID() as initial value for this column. Please test well. An example from a test app below.

Suvrutt_Gurjar_0-1646800226138.png

Edit: I had missed this part but we will have users also pouring information into the database through a web-app as well." in your post. The reference article I shared is basically for recommended practice for key column in MYSQL DB connected to an AppSheet app. However the approach does not answer your requirement of "adding information in the DB through other app".

Yeap!

Thanks for the article but yes, this part is the one that will give us some trouble
"but we will have users also pouring information into the database through a web-app as well."

I would have imagine that MySQL has somethting similar to Appsheet UNIQUEID() but it seems that's not the case.

In MySQL the equivalent function is called: UUID()

Top Labels in this Space