@@ -11,6 +11,7 @@ This guide explains how to install SQLite on Windows with support for loading ex
1111## Using SQLite with Python
1212
13131 . ** Download Python**
14+
1415 Get the latest Python for Windows from <a href =" https://www.python.org/downloads/windows/ " target =" _blank " >python.org</a >.
1516
16172 . ** Install Python**
@@ -22,40 +23,40 @@ This guide explains how to install SQLite on Windows with support for loading ex
22233 . ** Check your installation**
2324 Open Command Prompt and run:
2425
25- ``` bash
26- python --version
27- python -c " import sqlite3; print('SQLite version:', sqlite3.sqlite_version)"
28- ```
26+ ``` bash
27+ python --version
28+ python -c " import sqlite3; print('SQLite version:', sqlite3.sqlite_version)"
29+ ```
2930
30314 . ** Download the Extension**
32+
3133 Go to <a href =" https://github.com/sqliteai/sqlite-sync/releases " target =" _blank " >sqlite-sync releases</a > and download the extension.
3234
33355 . ** Load Extension**
34-
35- ``` python
36- import sqlite3
37- import os
38-
39- # Path to your compiled extension (.dll for Windows)
40- EXTENSION_PATH = os.path.abspath(" cloudsync" )
41-
42- # Connect to SQLite and enable extension loading
43- conn = sqlite3.connect(" :memory:" )
44- conn.enable_load_extension(True )
45-
46- # Load the extension
47- try :
48- conn.load_extension(EXTENSION_PATH )
49- print (" Extension loaded successfully." )
50- except sqlite3.OperationalError as e:
51- print (f " Failed to load extension: { e} " )
52-
53- conn.enable_load_extension(False )
54-
55- # Optionally test it (e.g., call a custom SQL function)
56- cursor = conn.execute(" SELECT cloudsync_version();" )
57- print (cursor.fetchone())
58- ```
36+ ``` python
37+ import sqlite3
38+ import os
39+
40+ # Path to your compiled extension (.dll for Windows)
41+ EXTENSION_PATH = os.path.abspath(" cloudsync" )
42+
43+ # Connect to SQLite and enable extension loading
44+ conn = sqlite3.connect(" :memory:" )
45+ conn.enable_load_extension(True )
46+
47+ # Load the extension
48+ try :
49+ conn.load_extension(EXTENSION_PATH )
50+ print (" Extension loaded successfully." )
51+ except sqlite3.OperationalError as e:
52+ print (f " Failed to load extension: { e} " )
53+
54+ conn.enable_load_extension(False )
55+
56+ # Optionally test it (e.g., call a custom SQL function)
57+ cursor = conn.execute(" SELECT cloudsync_version();" )
58+ print (cursor.fetchone())
59+ ```
5960
6061## Using SQLite with C#
6162
0 commit comments