Porting and testing embedded database SQLite

Source: Internet
Author: User
Latest

I. Test 1. download the latest sqlite source code sqlite-autoconf-3070500.tar.gz from the sqlite website http://sqlite.org/download.html. The latest version

I. Test

1. download the latest sqlite source code sqlite-autoconf-3070500.tar.gz from the sqlite website. The latest version is 3.7.5.

2. decompress the source code, enter the source code folder mkdir _ install, configure correctly, and generate the correct Makefile.

The Configure command is as follows:

CC =/usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-gcc CXX =/usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-g ++. /configure -- host = arm-linux -- prefix = 'pwd'/_ install -- disable-tcl

3. Make

4. Make install copy the generated content to the directory specified by./configure-prefix, that is, the _ install Folder.

5. Copy the compiled sqlite3 to the development board File System/bin directory.

Copy the compiled library files in the/lib directory to the/lib directory of the Development Board.

The cross compiler also supports the sqlite3 method:

Copy the compiled library files in the/include directory to the Cross-compiler/include directory.

Copy the compiled library files in the/lib directory to the Cross Compiler/lib directory.

6. Run sqlite3 on the development board. If the following prompt is displayed, the sqlite port is successfully transplanted.

SQLite version 3.7.5
Enter ". help" for instructions
Enter SQL statements terminated with ";"
Sqlite

2. Database Testing;

1. simple command test:

Sqlite> create table film (number, name );
Sqlite> insert into film values (1, 'aaa ');
Sqlite> insert into film values (2, 'bbb ');
Sqlite> select * from film;
1 | aaa
2 | bbb
Sqlite>. quit

2. Cross-compile the sqlite_test application to test sqlite. The application source code and Makefile file are in the compressed package sqlite_test.tar.bz2.

Test command:

./Sqlite_test new. db "create table film (number, name )"

./Sqlite_test test. db "insert"

./Sqlite_test test. db "select * from test. db"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.