Skip to content

Commit 9dda8fe

Browse files
committed
Update doc
1 parent 3922a0e commit 9dda8fe

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ In this mode, a table is created with just 2 columns, `key` and `value` as shown
5353
```c++
5454
#include "sqlite_index_blaster.h"
5555
#include <string>
56-
#include <vector>
5756

5857
int main() {
5958

60-
std::vector<std::string> col_names = {"key", "value"}; // -std >= c++11
59+
std::string col_names = "key, value"; // -std >= c++11
6160
sqlite_index_blaster sqib(2, 1, col_names, "kv_index", 4096, 40, "kv_idx.db");
6261
sqib.put_string("hello", "world");
6362
return 0;
@@ -87,10 +86,9 @@ To retrieve the inserted values, use `get` method as shown below
8786
```c++
8887
#include "sqlite_index_blaster.h"
8988
#include <string>
90-
#include <vector>
9189

9290
int main() {
93-
std::vector<std::string> col_names = {"key", "value"}; // -std >= c++11
91+
std::string col_names = "key, value"; // -std >= c++11
9492
sqlite_index_blaster sqib(2, 1, col_names, "kv_index", 4096, 40, "kv_idx.db");
9593
sqib.put_string("hello", "world");
9694
std::cout << "Value of hello is " << sqib.get_string("hello", "not_found") << std::endl;
@@ -105,13 +103,12 @@ In this mode, a table is created with just 2 columns, `key` and `doc` as shown b
105103
```c++
106104
#include "sqlite_index_blaster.h"
107105
#include <string>
108-
#include <vector>
109106

110107
const char * json1 = "{\"name\": \"Alice\", \"age\": 25, \"email\": \"alice@example.com\"}";
111108
const char * json2 = "{\"name\": \"George\", \"age\": 32, \"email\": \"george@example.com\"}";
112109

113110
int main() {
114-
std::vector<std::string> col_names = {"key", "doc"}; // -std >= c++11
111+
std::string col_names = "key, doc"; // -std >= c++11
115112
sqlite_index_blaster sqib(2, 1, col_names, "doc_index", 4096, 40, "doc_store.db");
116113
sqib.put_string("primary_contact", json1);
117114
sqib.put_string("secondary_contact", json2);
@@ -134,15 +131,14 @@ This repo can be used to create regular tables with primary key(s) as shown belo
134131
```c++
135132
#include <cmath>
136133
#include <string>
137-
#include <vector>
138134

139135
#include "sqlite_index_blaster.h"
140136

141137
const uint8_t col_types[] = {SQLT_TYPE_TEXT, SQLT_TYPE_INT8, SQLT_TYPE_INT8, SQLT_TYPE_INT8, SQLT_TYPE_INT8, SQLT_TYPE_REAL};
142138

143139
int main() {
144140

145-
std::vector<std::string> col_names = {"student_name", "age", "maths_marks", "physics_marks", "chemistry_marks", "average_marks"};
141+
std::string col_names = "student_name, age, maths_marks, physics_marks, chemistry_marks, average_marks";
146142
sqlite_index_blaster sqib(6, 2, col_names, "student_marks", 4096, 40, "student_marks.db");
147143

148144
int8_t maths, physics, chemistry, age;

0 commit comments

Comments
 (0)