@fxjs/db-driver
Advanced tools
Comparing version 0.5.0 to 0.5.1-alpha.0
@@ -6,2 +6,7 @@ /// <reference types="fib-pool" /> | ||
const utils_1 = require("../utils"); | ||
const CodepointsList = require('../../codepoints-map.json'); | ||
const CodepointsMap = CodepointsList.reduce((accu, item) => { | ||
accu[item.codepoint] = item; | ||
return accu; | ||
}, {}); | ||
const win32CpInfo = utils_1.detectWindowsCodePoints(); | ||
@@ -28,2 +33,3 @@ class PostgreSQLDriver extends base_class_1.SQLDriver { | ||
const conn = super.open(); | ||
const matchedCodepoint = CodepointsMap[win32CpInfo.codepoints]; | ||
// TODO: support common codepoints -> postgresql-encoding | ||
@@ -33,2 +39,5 @@ if (conn.codec && win32CpInfo.codepoints === '936') { | ||
} | ||
else if (conn.codec && matchedCodepoint) { | ||
conn.codec = matchedCodepoint.dotNetName; | ||
} | ||
else if (conn.codec === 'utf8' && win32CpInfo.codepoints !== '65001') { | ||
@@ -35,0 +44,0 @@ console.error(`system default code points is '${win32CpInfo.codepoints}', but odbc try to use codec UTF8 with codepoints 65001, refer to https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers to set connection.codec as UTF8`); |
{ | ||
"name": "@fxjs/db-driver", | ||
"version": "0.5.0", | ||
"version": "0.5.1-alpha.0", | ||
"description": "", | ||
@@ -55,3 +55,4 @@ "keywords": [ | ||
"lib", | ||
"typings" | ||
"typings", | ||
"codepoints-map.json" | ||
], | ||
@@ -61,3 +62,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "802d2e1def54ea48febbe436caae2f8e4f5959b5" | ||
"gitHead": "1100c3d4a54a46d59d7c191d9d593c0ea640ac3b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58476
22
1736