futool-db-v1.1版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
old-tom 6466b59c08
fix: 修复查询自动begin后,同一个session执行事务失败问题
2 years ago
.idea first commit 2 years ago
config 优化SqlFactory,加入对象缓存 2 years ago
executor fix: 修复查询自动begin后,同一个session执行事务失败问题 2 years ago
session fix: 修复查询自动begin后,同一个session执行事务失败问题 2 years ago
transaction first commit 2 years ago
util 优化SqlFactory,加入对象缓存 2 years ago
.gitignore first commit 2 years ago
Pipfile feat:1.升级python版本 2.更新依赖文件 2 years ago
Pipfile.lock feat: 替换cx_oracle为oracledb 2 years ago
db-conf.toml feat:使用pymssql替换pyodbc 2 years ago
main.py feat:使用pymssql替换pyodbc 2 years ago
readme.md feat:使用pymssql替换pyodbc 2 years ago
requirements.txt feat:使用pymssql替换pyodbc 2 years ago

readme.md

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

一、在m1 mac下使用pyodbc (大坑需要修改tsl协议版本不建议使用)

参考官方文档 https://github.com/mkleehammer/pyodbc/wiki

# 1.安装odbc
brew update
brew install unixodbc
# 2.安装sqlserver linux驱动
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18
# 3.安装pyodbc
pip install --no-binary :all: pyodbc
# 查看配置文件路径
odbcinst -j
# 输出
unixODBC 2.3.12
DRIVERS............: /opt/homebrew/etc/odbcinst.ini
SYSTEM DATA SOURCES: /opt/homebrew/etc/odbc.ini
FILE DATA SOURCES..: /opt/homebrew/etc/ODBCDataSources
USER DATA SOURCES..: /Users/old-tom/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
# 修改odbcinst.ini
[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/homebrew/lib/libmsodbcsql.18.dylib

二、在m1 mac下使用pymssql 连接sqlserver

参考官方文档 https://pymssql.readthedocs.io/en/stable/freetds.html

# 1.安装freetds
brew install freetds
# 2.修改配置
vim /opt/homebrew/etc/freetds.conf
在[global]下添加
port = 1443
tds version = 7.0  
# 3.测试连接
tsql -H 172.16.1.2 -p 1433 -U sa -P atdPriME@Gy9# -D credit
#  返回以下情况说明连接成功
locale is "zh_CN.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Setting credit as default database in login packet

freetds连接成功后安装pymssql

pip install pymssql