1
1
2
- ########################
3
- Getting Started with IDB
4
- ########################
2
+ ##############################
3
+ Getting Started with Interbase
4
+ ##############################
5
5
6
6
Installation
7
7
************
8
8
9
- IDB is written as pure-Python module on top of InterBase client library (gds.so/dylib and gds32/ibclient64.dll) using ctypes_,
10
- so *make sure you have InterBase client properly installed before you try to install IDB *, otherwise the
11
- installation will fail. IDB supports InterBase 2020 and higher.
9
+ Interbase is written as pure-Python module on top of InterBase client library (gds.so/dylib and gds32/ibclient64.dll) using ctypes_,
10
+ so *make sure you have InterBase client properly installed before you try to install Interbase *, otherwise the
11
+ installation will fail. Interbase supports InterBase 2020 and higher.
12
12
13
- IDB is distributed as `setuptools`_ package, so you'll need setuptools or
13
+ Interbase is distributed as `setuptools`_ package, so you'll need setuptools or
14
14
`compatible package <http://pypi.python.org/pypi/distribute>`_ installed to
15
- install IDB properly.
15
+ install Interbase properly.
16
16
17
17
Installation using pip
18
18
========================
19
19
20
- $ pip install git+ssh://
[email protected] /Embarcadero/
PythonInterBase .git
20
+ $ pip install git+ssh://
[email protected] /Embarcadero/
InterBasePython .git
21
21
22
22
Installation from source
23
23
========================
24
24
25
25
Download the source tarball, uncompress it, then run the install command::
26
26
27
- $ git clone https://github.com/Embarcadero/PythonInterBase .git
27
+ $ git clone https://github.com/Embarcadero/InterBasePython .git
28
28
$ python setup.py install
29
29
30
- .. _setuptools: https://github.com/Embarcadero/PythonInterBase
30
+ .. _setuptools: https://github.com/Embarcadero/InterBasePython
31
31
.. _PYPI: http://pypi.python.org
32
32
.. _ctypes: http://docs.python.org/library/ctypes.html
33
33
@@ -36,11 +36,11 @@ Quick-start Guide
36
36
*****************
37
37
38
38
This brief tutorial aims to get the reader started by demonstrating
39
- elementary usage of IDB . It is not a comprehensive Python
39
+ elementary usage of Interbase . It is not a comprehensive Python
40
40
Database API tutorial, nor is it comprehensive in its coverage of
41
41
anything else.
42
42
43
- The numerous advanced features of IDB are covered in another
43
+ The numerous advanced features of Interbase are covered in another
44
44
section of this documentation, which is not in a tutorial format, though it
45
45
is replete with examples.
46
46
@@ -55,13 +55,13 @@ A database connection is typically established with code such as this:
55
55
56
56
.. sourcecode:: python
57
57
58
- import idb
58
+ import interbase
59
59
60
60
# The server is named 'bison'; the database file is at '/temp/test.db'.
61
- con = idb .connect(dsn='bison:/temp/test.db', user='sysdba', password='pass')
61
+ con = interbase .connect(dsn='bison:/temp/test.db', user='sysdba', password='pass')
62
62
63
63
# Or, equivalently:
64
- con = idb .connect(
64
+ con = interbase .connect(
65
65
host='bison', database='/temp/test.db',
66
66
user='sysdba', password='masterkey'
67
67
)
@@ -74,9 +74,9 @@ UTF-8 as the character set of the connection:
74
74
75
75
.. sourcecode:: python
76
76
77
- import idb
77
+ import interbase
78
78
79
- con = idb .connect(
79
+ con = interbase .connect(
80
80
dsn='bison:/temp/test.db',
81
81
user='sysdba', password='masterkey',
82
82
charset='UTF8' # specify a character set for the connection
@@ -108,9 +108,9 @@ the `languages` table:
108
108
109
109
.. sourcecode:: python
110
110
111
- import idb
111
+ import interbase
112
112
113
- con = idb .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
113
+ con = interbase .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
114
114
115
115
# Create a Cursor object that operates in the context of Connection con:
116
116
cur = con.cursor()
@@ -136,9 +136,9 @@ fetching a single row at a time from a `SELECT`-cursor:
136
136
137
137
.. sourcecode:: python
138
138
139
- import idb
139
+ import interbase
140
140
141
- con = idb .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
141
+ con = interbase .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
142
142
143
143
cur = con.cursor()
144
144
SELECT = "select name, year_released from languages order by year_released"
@@ -179,19 +179,19 @@ example to `languages`):
179
179
180
180
.. sourcecode:: python
181
181
182
- import idb
182
+ import interbase
183
183
184
184
TABLE_NAME = 'languages'
185
185
SELECT = 'select * from %s order by year_released' % TABLE_NAME
186
186
187
- con = idb .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
187
+ con = interbase .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
188
188
189
189
cur = con.cursor()
190
190
cur.execute(SELECT)
191
191
192
192
# Print a header.
193
193
for fieldDesc in cur.description:
194
- print fieldDesc[idb .DESCRIPTION_NAME].ljust(fieldDesc[idb .DESCRIPTION_DISPLAY_SIZE]) ,
194
+ print fieldDesc[interbase .DESCRIPTION_NAME].ljust(fieldDesc[interbase .DESCRIPTION_DISPLAY_SIZE]) ,
195
195
print # Finish the header with a newline.
196
196
print '-' * 78
197
197
@@ -201,7 +201,7 @@ example to `languages`):
201
201
for row in cur:
202
202
for fieldIndex in fieldIndices:
203
203
fieldValue = str(row[fieldIndex])
204
- fieldMaxWidth = cur.description[fieldIndex][idb .DESCRIPTION_DISPLAY_SIZE]
204
+ fieldMaxWidth = cur.description[fieldIndex][interbase .DESCRIPTION_DISPLAY_SIZE]
205
205
206
206
print fieldValue.ljust(fieldMaxWidth) ,
207
207
@@ -224,9 +224,9 @@ Let's insert more languages:
224
224
225
225
.. sourcecode:: python
226
226
227
- import idb
227
+ import interbase
228
228
229
- con = idb .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
229
+ con = interbase .connect(dsn='bison:/temp/test.db', user='sysdba', password='masterkey')
230
230
231
231
cur = con.cursor()
232
232
@@ -281,7 +281,7 @@ retrieved from a stored procedure by `SELECT`ing from the procedure,
281
281
whereas output parameters are retrieved with an `EXECUTE PROCEDURE`
282
282
statement.
283
283
add
284
- To *retrieve a result set* from a stored procedure with IDB ,
284
+ To *retrieve a result set* from a stored procedure with Interbase ,
285
285
use code such as this:
286
286
287
287
.. sourcecode:: python
0 commit comments