Because the project needs to use the database, and it cannot depend on a specific platform but also has the flexibility, so I thought of SQLite, and then got the source code and started to modify and use it. Here we want
Because the project needs to use the database, and it cannot depend on a specific platform but also has the flexibility, so I thought of SQLite, and then got the source code and started to modify and use it. Here we want
Because the project needs to use the database, and it cannot depend on a specific platform but also requires flexibility, so I thought of SQLite and started to modify and use the source code. Here I will record it for the sake of memo, the following is a simple example, and I hope to help some people who are new to SQLite.
Briefly speaking, first define the added, deleted, modified, and queried strings, then format the strings as needed, and finally generate the execution command string, and then call the function that executes the SQL statement. here we need to pass several parameters, take the search as an example. There is a function called back after the result is found. If the result is found, the function is called back and passed in. Please note here, every time a record is found, the specified function is called back and the result is passed over. The parameters of the result callback function are briefly described here, the first parameter is a user-defined parameter specified for the result callback function when calling the SQL statement to execute the function. The second parameter is the number of fields in a record, corresponding to argv and aszColName, for example, argv [0] is the first field value of the current record (which can be understood as a row), aszColName [0] is the field name of the current record, and others are better understood, it's no longer awkward. It's time to forget it.