result['db'] = tostring(options['db'])
elseif options['dbname'] then
result['db'] = tostring(options['dbname'])
+ elseif options['database'] then
+ result['db'] = tostring(options['database'])
end
end
if options['password'] and not result['password'] then
elt = ucl_object_lookup_any (obj, "db", "database", "dbname", NULL);
if (elt) {
- backend->dbname = ucl_object_tostring (elt);
+ if (ucl_object_type (elt) == UCL_STRING) {
+ backend->dbname = ucl_object_tostring (elt);
+ }
+ else if (ucl_object_type (elt) == UCL_INT) {
+ backend->dbname = ucl_object_tostring_forced (elt);
+ }
}
else {
backend->dbname = NULL;
elt = ucl_object_lookup_any (obj, "db", "database", "dbname", NULL);
if (elt) {
- cache_ctx->dbname = ucl_object_tostring (elt);
+ if (ucl_object_type (elt) == UCL_STRING) {
+ cache_ctx->dbname = ucl_object_tostring (elt);
+ }
+ else if (ucl_object_type (elt) == UCL_INT) {
+ cache_ctx->dbname = ucl_object_tostring_forced (elt);
+ }
}
else {
cache_ctx->dbname = NULL;