nexusql 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1854,7 +1854,9 @@ var Database = class _Database {
1854
1854
  async installExtensions(extensions) {
1855
1855
  for (const ext of extensions) {
1856
1856
  try {
1857
- await this.exec(`CREATE EXTENSION IF NOT EXISTS ${ext};`);
1857
+ const needsQuoting = /[^a-z0-9_]/i.test(ext);
1858
+ const quotedExt = needsQuoting ? `"${ext}"` : ext;
1859
+ await this.exec(`CREATE EXTENSION IF NOT EXISTS ${quotedExt};`);
1858
1860
  const result = await this.queryParams(
1859
1861
  `SELECT EXISTS(SELECT 1 FROM pg_extension WHERE extname = $1) as exists`,
1860
1862
  [ext]