Page 1 of 1

How do i get database_id from code?

Posted: Fri Mar 14, 2014 7:38 pm
by Sunrising

How do i get database_id from code?

Is it in some variable? or in localStorage?


How do i get database_id from code?

Posted: Fri Mar 14, 2014 8:07 pm
by Nikita

Hello,

From what code? The fact is that a single application may use many different databases. Or do you want to get database_id for specific service?


How do i get database_id from code?

Posted: Fri Mar 14, 2014 8:45 pm
by Sunrising

From javascript code,
I have only one database for my app, anyway i want it for a specific service... is there another way other than copy it from the database page?

thanks a lot!


How do i get database_id from code?

Posted: Fri Mar 14, 2014 9:17 pm
by Nikita

Hi,

You can add DB service to project in this way:
http://docs.appery.io/documentation/b...
Appery.io will prescribe database_id automatically.


How do i get database_id from code?

Posted: Fri Mar 14, 2014 9:30 pm
by Sunrising

yes, i know, thanks, but i would like to konw if there is a way of getting it manually from javascript.

thanks a gain


How do i get database_id from code?

Posted: Fri Mar 14, 2014 10:07 pm
by Nikita

If id DB is specified in service settings DB, then you can get it like this:

myDB_settings.database_id
where myDB_settings -- name of service settings