使用Node.JS和SQL Server始终加密插入数据库时 出错

问题描述 投票:0回答:1

我使用带有始终加密功能的SQL Server数据库。当我尝试插入一行时,它会失败并抛出错误

let request = new Request(`INSERT INTO [dbo].[table_name] ([Name])
                           VALUES ('test')`,
                function (err, rowCount, rows) {
                    if (err) {
                        console.log('errr--', err);
                    } else {
                        console.log(' row(s) ', rows);
                    }
                });

错误:

RequestError:操作数类型冲突:varchar与使用(encryption_type ='DETERMINISTIC',encryption_algorithm_name ='AEAD_AES_256_CBC_HMAC_SHA_256',column_encryption_key_name ='CEK_Auto1',column_encryption_key_database_name ='DrugstoreDB')加密的varchar(8000)不兼容collat​​ion_name ='SQL_Latin1_General_CP1_CI_AS'_```

问题出在哪儿?

sql-server node.js azure encryption always-encrypted
1个回答
0
投票

AlwaysEncrypted是客户端加密,因此必须由客户端驱动程序支持。 AFAIK当前已实现AlwaysEncrypted的客户端库列表是:

-SqlClient for .NET Framework(但不是.NET Core / .NET标准版)

适用于Windows的SQL Server的Microsoft ODBC驱动程序

适用于Linux的SQL Server的Microsoft ODBC驱动程序

-Microsoft JDBC驱动程序用于SQL Server

© www.soinside.com 2019 - 2024. All rights reserved.