const params = formatSingleParams();

'use api/core/runtime/database/sql/tables.js';
'use api/lib/camelAndUnderscore.js';

function main() {
	// 验证用户权限
	'use api/user/acl/excerpt.js'

	let db_name = payload.get().query.db_name;
	if (db_name) {
		DB_NAME = db_name;
	}

	let tables = getTablesInfo();
	let result = [];
	tables.result.forEach((t) => {
		const newObj = Object.keys(t).reduce((acc, key) => {
			acc[underscoreToCamel(key.toLowerCase())] = t[key];
			return acc;
		}, {});
		result.push(newObj);
	});

	return okMsg({ data: result, count: tables.count });
}
