@@ -66,10 +66,10 @@ Note: The cache size is used as 40kb in these examples, but in real life 32mb or
6666In this mode, a table is created with just 2 columns, ` key ` and ` value ` as shown below:
6767
6868``` python
69- import sqlite_blaster_python
69+ import sqlite_blaster_python as m
7070
7171col_names = " key, value"
72- sqib = sqlite_blaster_python .sqlite_index_blaster(2 , 1 , col_names, " imain" , 4096 , 40000 , " kv_idx.db" )
72+ sqib = m .sqlite_index_blaster(2 , 1 , col_names, " imain" , 4096 , 40000 , " kv_idx.db" )
7373sqib.put_string(" hello" , " world" )
7474sqib.close()
7575```
@@ -93,10 +93,10 @@ COMMIT;
9393To retrieve the inserted values, use ` get ` method as shown below
9494
9595``` python
96- import sqlite_blaster_python
96+ import sqlite_blaster_python as m
9797
9898col_names = " key, value"
99- sqib = sqlite_blaster_python .sqlite_index_blaster(2 , 1 , col_names, " imain" , 4096 , 40 , " kv_idx.db" )
99+ sqib = m .sqlite_index_blaster(2 , 1 , col_names, " imain" , 4096 , 40 , " kv_idx.db" )
100100sqib.put_string(" hello" , " world" )
101101print (" Value of hello is" , sqib.get_string(" hello" , " not_found" ))
102102sqib.close()
@@ -109,13 +109,13 @@ The second parameter to `get_string` is for specifying what value is to be retur
109109In this mode, a table is created with just 2 columns, ` key ` and ` doc ` as shown below:
110110
111111``` python
112- import sqlite_blaster_python
112+ import sqlite_blaster_python as m
113113
114114json1
= ' {"name": "Alice", "age": 25, "email": "[email protected] "}' 115115json2
= ' {"name": "George", "age": 32, "email": "[email protected] "}' 116116
117117col_names = " key, doc"
118- sqib = sqlite_blaster_python .sqlite_index_blaster(2 , 1 , col_names, " doc_index" , 4096 , 40 , " doc_store.db" )
118+ sqib = m .sqlite_index_blaster(2 , 1 , col_names, " doc_index" , 4096 , 40 , " doc_store.db" )
119119sqib.put_string(" primary_contact" , json1)
120120sqib.put_string(" secondary_contact" , json2)
121121sqib.close()
@@ -134,10 +134,10 @@ WHERE key = 'primary_contact';
134134This repo can be used to create regular tables with primary key(s) as shown below:
135135
136136``` python
137- import sqlite_blaster_python
137+ import sqlite_blaster_python as m
138138
139139col_names = " student_name, age, maths_marks, physics_marks, chemistry_marks, average_marks"
140- sqib = sqlite_blaster_python .sqlite_index_blaster(6 , 2 , col_names, " student_marks" , 4096 , 40 , " student_marks.db" )
140+ sqib = m .sqlite_index_blaster(6 , 2 , col_names, " student_marks" , 4096 , 40 , " student_marks.db" )
141141
142142sqib.put_rec([" Robert" , 19 , 80 , 69 , 98 , round ((80 + 69 + 98 )/ 3 , 2 )])
143143sqib.put_rec([" Barry" , 20 , 82 , 99 , 83 , round ((82 + 99 + 83 )/ 3 , 2 )])
0 commit comments