Python Connector for SQLite

Using the module - Python Connector for SQLite

Using the module

To retrieve data from SQLite:

  1. Import the module.
    import devart.sqlite
  2. Connect to a database using the connect() module method and obtain a connection object:
    • If you're using the Direct mode:
      my_connection = devart.sqlite.connect(
          Direct=True,
          Database="your_database"
      )
    • If you're using a dynamically linked SQLite client library:
      my_connection = devart.sqlite.connect(
          Direct=False,
          Database="your_database",
          ClientLibrary="your_sqlite_lib"
      )
  3. Create a cursor object using the cursor() connection method.
    my_cursor = my_connection.cursor()
  4. Execute the SQL statement using the execute() cursor method.
    my_cursor.execute("SELECT * FROM employees")
  5. Retrieve the result set using one of the fetch*() cursor methods.
    for row in my_cursor.fetchall(): 
        print(row)
© 2022-2025 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback