File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,44 @@ cursor.close()
115115connection.close()
116116```
117117
118+ ### Python (turbodbc)
119+
120+ [ turbodbc] is a Python module to access relational databases via the Open
121+ Database Connectivity (ODBC) interface. turbodbc offers built-in NumPy and
122+ Apache Arrow for maximum performance.
123+
124+ ``` shell
125+ pip install --upgrade turbodbc
126+ ```
127+ ``` python
128+ import turbodbc
129+
130+ # Connect to database
131+ connection_string = \
132+ " Driver={PostgreSQL ODBC};Server=localhost;Port=5432;" \
133+ " Uid=crate;Pwd=crate;Database=doc;MaxVarcharSize=1073741824"
134+ connection = turbodbc.connect(connection_string)
135+
136+ # Invoke query
137+ cursor = connection.cursor()
138+ cursor.execute(" SELECT * FROM sys.summits ORDER BY height DESC LIMIT 5" )
139+
140+ # Display results
141+ for row in cursor:
142+ print (row)
143+
144+ # Clean up
145+ cursor.close()
146+ connection.close()
147+ ```
148+
149+ :::{todo}
150+ Enable with the [ Python patch] ( https://github.com/crate/cratedb-guide/pull/403 ) .
151+ ```
152+ - {ref}`Turbodbc -- a high-performance ODBC library <turbodbc>`
153+ ```
154+ :::
155+
118156### Visual Basic
119157
120158See also [ psqlODBC with Visual Basic] . Please navigate to the
@@ -156,3 +194,4 @@ cn.Close
156194[ pyodbc ] : https://github.com/mkleehammer/pyodbc
157195[ pyodbc installation instructions ] : https://github.com/mkleehammer/pyodbc/wiki/Install
158196[ System.Data.Odbc ] : https://learn.microsoft.com/en-us/dotnet/api/system.data.odbc
197+ [ turbodbc ] : https://turbodbc.readthedocs.io/
You can’t perform that action at this time.
0 commit comments