readme.txt 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. Project
  2. -------
  3. adodbapi
  4. A Python DB-API 2.0 (PEP-249) module that makes it easy to use Microsoft ADO
  5. for connecting with databases and other data sources
  6. using either CPython or IronPython.
  7. Home page: <http://sourceforge.net/projects/adodbapi>
  8. Features:
  9. * 100% DB-API 2.0 (PEP-249) compliant (including most extensions and recommendations).
  10. * Includes pyunit testcases that describe how to use the module.
  11. * Fully implemented in Python. -- runs in Python 2.5+ Python 3.0+ and IronPython 2.6+
  12. * Licensed under the LGPL license, which means that it can be used freely even in commercial programs subject to certain restrictions.
  13. * The user can choose between paramstyles: 'qmark' 'named' 'format' 'pyformat' 'dynamic'
  14. * Supports data retrieval by column name e.g.:
  15. for row in myCurser.execute("select name,age from students"):
  16. print("Student", row.name, "is", row.age, "years old.")
  17. * Supports user-definable system-to-Python data conversion functions (selected by ADO data type, or by column)
  18. Prerequisites:
  19. * C Python 2.7 or 3.5 or higher
  20. and pywin32 (Mark Hammond's python for windows extensions.)
  21. or
  22. Iron Python 2.7 or higher. (works in IPy2.0 for all data types except BUFFER)
  23. Installation:
  24. * (C-Python on Windows): Install pywin32 ("pip install pywin32") which includes adodbapi.
  25. * (IronPython on Windows): Download adodbapi from http://sf.net/projects/adodbapi. Unpack the zip.
  26. Open a command window as an administrator. CD to the folder containing the unzipped files.
  27. Run "setup.py install" using the IronPython of your choice.
  28. NOTE: ...........
  29. If you do not like the new default operation of returning Numeric columns as decimal.Decimal,
  30. you can select other options by the user defined conversion feature.
  31. Try:
  32. adodbapi.apibase.variantConversions[adodbapi.ado_consts.adNumeric] = adodbapi.apibase.cvtString
  33. or:
  34. adodbapi.apibase.variantConversions[adodbapi.ado_consts.adNumeric] = adodbapi.apibase.cvtFloat
  35. or:
  36. adodbapi.apibase.variantConversions[adodbapi.ado_consts.adNumeric] = write_your_own_convertion_function
  37. ............
  38. notes for 2.6.2:
  39. The definitive source has been moved to https://github.com/mhammond/pywin32/tree/master/adodbapi.
  40. Remote has proven too hard to configure and test with Pyro4. I am moving it to unsupported status
  41. until I can change to a different connection method.
  42. whats new in version 2.6
  43. A cursor.prepare() method and support for prepared SQL statements.
  44. Lots of refactoring, especially of the Remote and Server modules (still to be treated as Beta code).
  45. The quick start document 'quick_reference.odt' will export as a nice-looking pdf.
  46. Added paramstyles 'pyformat' and 'dynamic'. If your 'paramstyle' is 'named' you _must_ pass a dictionary of
  47. parameters to your .execute() method. If your 'paramstyle' is 'format' 'pyformat' or 'dynamic', you _may_
  48. pass a dictionary of parameters -- provided your SQL operation string is formatted correctly.
  49. whats new in version 2.5
  50. Remote module: (works on Linux!) allows a Windows computer to serve ADO databases via PyRO
  51. Server module: PyRO server for ADO. Run using a command like= C:>python -m adodbapi.server
  52. (server has simple connection string macros: is64bit, getuser, sql_provider, auto_security)
  53. Brief documentation included. See adodbapi/examples folder adodbapi.rtf
  54. New connection method conn.get_table_names() --> list of names of tables in database
  55. Vastly refactored. Data conversion things have been moved to the new adodbapi.apibase module.
  56. Many former module-level attributes are now class attributes. (Should be more thread-safe)
  57. Connection objects are now context managers for transactions and will commit or rollback.
  58. Cursor objects are context managers and will automatically close themselves.
  59. Autocommit can be switched on and off.
  60. Keyword and positional arguments on the connect() method work as documented in PEP 249.
  61. Keyword arguments from the connect call can be formatted into the connection string.
  62. New keyword arguments defined, such as: autocommit, paramstyle, remote_proxy, remote_port.
  63. *** Breaking change: variantConversion lookups are simplified: the following will raise KeyError:
  64. oldconverter=adodbapi.variantConversions[adodbapi.adoStringTypes]
  65. Refactor as: oldconverter=adodbapi.variantConversions[adodbapi.adoStringTypes[0]]
  66. License
  67. -------
  68. LGPL, see http://www.opensource.org/licenses/lgpl-license.php
  69. Documentation
  70. -------------
  71. Look at adodbapi/quick_reference.md
  72. http://www.python.org/topics/database/DatabaseAPI-2.0.html
  73. read the examples in adodbapi/examples
  74. and look at the test cases in adodbapi/test directory.
  75. Mailing lists
  76. -------------
  77. The adodbapi mailing lists have been deactivated. Submit comments to the
  78. pywin32 or IronPython mailing lists.
  79. -- the bug tracker on sourceforge.net/projects/adodbapi may be checked, (infrequently).
  80. -- please use: https://github.com/mhammond/pywin32/issues