In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to transplant SQLite database". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to transplant SQLite database.
In embedded products with small systems, porting SQLite database is a necessary work. The following is a detailed description of the steps for porting SQLite databases to arm-linux-gcc 's arm products. Before migrating, it is important to make sure that arm-linux-gcc compilation is installed properly.
SQLite, a lightweight database, is an ACID-compliant relational database management system, which is contained in a relatively small C library. It is a public domain project established by D.RichardHipp. Its design goal is embedded, and it has been used in many embedded products, it occupies very low resources, in embedded devices, it may only need a few hundred kilogrammes of memory.
Sqlite official website: https://www.sqlite.org/
1. Put the sqlite-autoconf-3090200.tar.gz installation package under a path and extract the tar-xf sqlite-autoconf-3090200.tar.gz
2. Create an empty folder for sqlite
3. Enter the newly extracted folder sqlite-autoconf-3090200, and execute the configuration command. / configure-- host=arm-linux-- prefix=/opt/toolschain/sqlite
4. Execute the make command
5. Execute the make install command
6. When you are finished, go to the newly created sqlite database to see if some folders are generated.
7. Bin folder
Note: there is a sqlite3 file under the Bin folder. When the arm development board wants to use the sqlite database, copy this file under the development board. The general path is under / user/bin under the file system, and there are other paths, depending on the situation.
8. Lib folder
Note: these are some library connection files, copy all these files to the development board's file system under / user/lib, and there are other paths, as appropriate.
9. Include folder
The sqlite3.h under this folder is the file to be used by our application. When you want to manipulate the database, you can include this file, for example, this file is included under my project.
10. Because of the static library connections used by my project, see makefile
So I need to copy the libsqlite3.a under the build file lib to my project folder. I don't need it if I use dynamic one. Pay attention to this.
11. Compile the project
A sequence of errors occurred when compiling the project, and the function could not be found
The solution to this problem is to add-ldl at compile time.
12. Sqlite has been successfully made, this is for arm-linux platform, and the transplant of other platforms is similar.
13. Sqlite common basic commands
Create a new database
Sqlite3 databasefilename
Insert record
Insert into table_name values (field1, field2, field3...)
Query
Select * from table_name; view all records in the table_ name table
Select * from table_name where field1='xxxxx'; queries records that meet the specified criteria
Delete
Delete from table_name where...
Delete tabl
Drop table_name; delete table
Drop index_name; delete index
Modify
Update table_name set xxx=value [, xxx=value,...] Where...
Export the HTML table:
Sqlite3-html film.db "select * from film;" Thank you for reading, the above is the content of "how to transplant SQLite database". After the study of this article, I believe you have a deeper understanding of how to transplant SQLite database, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.