
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
.. *************************************************************************** .. Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. .. ***************************************************************************
This package provides a python interface to the SQL Anywhere database server. This interface conforms to PEP 249.
Before installing the sqlanydb interface please make sure the following components are installed on your system.
Run the following command as an administrative user to install sqlanydb::
python setup.py install
Alternatively, you can use pip::
pip install sqlanydb
This library wraps around the sqlanydb dbcapi
C library. When retrieving
values from the database, the C API returns one of these types:
Other types are returned as the above types. For example, the NUMERIC type is returned as a string.
To have sqlanydb
return a different or custom python object, you can register
callbacks with the sqlanydb
module, using
register_converter(datatype, callback)
. Callback is a function that takes
one argument, the type to be converted, and should return the converted value.
Datatype is one of the DT_
variables present in the module.
The types available to register a converter for:
For example, to have NUMERIC types be returned as a python Decimal object::
import decimal
def decimal_callback(valueToConvert):
return decimal.Decimal(valueToConvert)
sqlanydb.register_converter(sqlanydb.DT_DECIMAL, decimal_callback)
To test that the Python interface to SQL Anywhere is working correctly first start the demo database included with your SQL Anywhere installation and then create a file named test_sqlany.py with the following contents::
import sqlanydb
conn = sqlanydb.connect(uid='dba', pwd='sql', eng='demo', dbn='demo' )
curs = conn.cursor()
curs.execute("select 'Hello, world!'")
print( "SQL Anywhere says: %s" % curs.fetchone() )
curs.close()
conn.close()
Run the test script and ensure that you get the expected output::
> python test_sqlany.py
SQL Anywhere says: Hello, world!
This package is licensed under the terms of the Apache License, Version 2.0. See the LICENSE file for details.
For feedback on this project, or for general questions about using SQL Anywhere please use the SQL Anywhere Forum at http://sqlanywhere-forum.sap.com/
FAQs
pure Python SQL Anywhere database interface
We found that sqlanydb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.