📄 compile.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Compilation Options For SQLite</title><style type="text/css">body { margin: auto; font-family: "Verdana" "sans-serif"; padding: 8px 1%;}a { color: #45735f }a:visited { color: #734559 }.logo { position:absolute; margin:3px; }.tagline { float:right; text-align:right; font-style:italic; width:240px; margin:12px; margin-top:58px;}.toolbar { font-variant: small-caps; text-align: center; line-height: 1.6em; margin: 0; padding:1px 8px;}.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }.toolbar a:visited { color: white; }.toolbar a:hover { color: #80a796; background: white; }.content { margin: 5%; }.content dt { font-weight:bold; }.content dd { margin-bottom: 25px; margin-left:20%; }.content ul { padding:0px; padding-left: 15px; margin:0px; }/* rounded corners */.se { background: url(images/se.png) 100% 100% no-repeat #80a796}.sw { background: url(images/sw.png) 0% 100% no-repeat }.ne { background: url(images/ne.png) 100% 0% no-repeat }.nw { background: url(images/nw.png) 0% 0% no-repeat }</style><meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head><body><div><!-- container div to satisfy validator --><a href="index.html"><img class="logo" src="images/SQLite.gif" alt="SQLite Logo" border="0"></a><div><!-- IE hack to prevent disappearing logo--></div><div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div><table width=100% style="clear:both"><tr><td> <div class="se"><div class="sw"><div class="ne"><div class="nw"> <div class="toolbar"> <a href="about.html">About</a> <a href="sitemap.html">Sitemap</a> <a href="docs.html">Documentation</a> <a href="download.html">Download</a> <a href="copyright.html">License</a> <a href="news.html">News</a> <a href="http://www.sqlite.org/cvstrac/index">Developers</a> <a href="support.html">Support</a> </div></div></div></div></div></td></tr></table> <?xml version="1.0" encoding="Windows-1252"?><h1>1.0 Compilation Options For SQLite</h1><p>For most purposes, SQLite can be built just fine using the defaultcompilation options. However, if required, the compile-time optionsdocumented below can be used to <a href="#omitfeatures">omit SQLite features</a> (resulting ina smaller compiled library size) or to change the<a href="#defaults">default values</a> of some parameters.</p><p>Every effort has been made to ensure that the various combinationsof compilation options work harmoniously and produce a working library.Nevertheless, it is strongly recommended that the SQLite test-suitebe executed to check for errors before using an SQLite library builtwith non-standard compilation options.</p><a name="defaults"></a><h2>1.1 Options To Set Default Parameter Values</h2><a name="default_autovacuum"></a><p><b>SQLITE_DEFAULT_AUTOVACUUM=<i><1 or 0></i></b></p><blockquote><p> This macro determines if SQLite creates databases with the <a href="pragma.html#pragma_auto_vacuum">auto_vacuum</a> flag set by default. The default value is 0 (do not create auto-vacuum databases). In any case the compile-time default may be overridden by the <a href="pragma.html#pragma_auto_vacuum">PRAGMA auto_vacuum</a> command.</p></blockquote><a name="default_cache_size"></a><p><b>SQLITE_DEFAULT_CACHE_SIZE=<i><pages></i></b></p><blockquote><p> This macro sets the default size of the page-cache for each attached database, in pages. This can be overridden by the <a href="pragma.html#pragma_cache_size">PRAGMA cache_size</a> command. The default value is 2000.</p></blockquote><a name="default_file_format"></a><p><b>SQLITE_DEFAULT_FILE_FORMAT=<i><1 or 4></i></b></p><blockquote><p> The default schema-level file format used by SQLite when creating new database files is set by this macro. The file formats are all very similar. The difference between formats 1 and 4 is that format 4 understands descending indices and has a tighter encoding for boolean values.</p><p> SQLite (as of <a href="releaselog/3_6_0.html">version 3.6.0</a>) can read and write any file format between 1 and 4. But older versions of SQLite might not be able to read formats greater than 1. So that older versions of SQLite will be able to read and write database files created by newer versions of SQLite, the default file format is set to 1 for maximum compatibility.</p><p> The file format for a new database can be set at runtime using the <a href="pragma.html#pragma_legacy_file_format">PRAGMA legacy_file_format</a> command.</p></blockquote><a name="default_memstatus"></a><p><b>SQLITE_DEFAULT_MEMSTATUS=<i><1 or 0></i></b></p><blockquote><p> This macro is used to determine whether or not the features enabled and disabled using the SQLITE_CONFIG_MEMSTATUS argument to <a href="c3ref/config.html">sqlite3_config()</a> are available by default. The default value is 1 (<a href="c3ref/c_config_getmalloc.html">SQLITE_CONFIG_MEMSTATUS</a> related features enabled).</p></blockquote><a name="default_page_size"></a><p><b>SQLITE_DEFAULT_PAGE_SIZE=<i><bytes></i></b></p><blockquote><p> This macro is used to set the default page-size used when a database is created. The value assigned must be a power of 2. The default value is 1024. The compile-time default may be overridden at runtime by the <a href="pragma.html#pragma_page_size">PRAGMA page_size</a> command.</p></blockquote><a name="default_temp_cache_size"></a><p><b>SQLITE_DEFAULT_TEMP_CACHE_SIZE=<i><pages></i></b></p><blockquote><p> This macro sets the default size of the page-cache for temporary files created by SQLite to store intermediate results, in pages. It does not affect the page-cache for the temp database, where tables created using <a href="lang_createtable.html">CREATE TEMP TABLE</a> are stored. The default value is 500.</p></blockquote><a name="yystackdepth"></a><p><b>YYSTACKDEPTH=<i><max_depth></i></b></p><blockquote><p> This macro sets the maximum depth of the LALR(1) stack used by the SQL parser within SQLite. The default value is 100. A typical application will use less than about 20 levels of the stack. Developers whose applications contain SQL statements that need more than 100 LALR(1) stack entries should seriously consider refactoring their SQL as it is likely to be well beyond the ability of any human to comprehend.</p></blockquote><h2>1.2 Options To Set Size Limits</h2><p>There are compile-time options that will set upper boundson the sizes of various structures in SQLite. The compile-timeoptions normally set a hard upper bound that can be changedat run-time on individual <a href="c3ref/sqlite3.html">database connections</a> using the<a href="c3ref/limit.html">sqlite3_limit()</a> interface.</p><p>The compile-time options for setting upper bounds are<a href="limits.html">documented separately</a>. The following is a list ofthe available settings:</p><ul><li> <a href="limits.html#max_attached">SQLITE_MAX_ATTACHED</a> </li><li> <a href="limits.html#max_column">SQLITE_MAX_COLUMN</a> </li><li> <a href="limits.html#max_compound_select">SQLITE_MAX_COMPOUND_SELECT</a> </li><li> <a href="limits.html#max_expr_depth">SQLITE_MAX_EXPR_DEPTH</a> </li><li> <a href="limits.html#max_function_arg">SQLITE_MAX_FUNCTION_ARG</a> </li><li> <a href="limits.html#max_length">SQLITE_MAX_LENGTH</a> </li><li> <a href="limits.html#max_like_pattern_length">SQLITE_MAX_LIKE_PATTERN_LENGTH</a> </li><li> <a href="limits.html#max_page_count">SQLITE_MAX_PAGE_COUNT</a> </li><li> <a href="limits.html#max_page_size">SQLITE_MAX_PAGE_SIZE</a> </li><li> <a href="limits.html#max_sql_length">SQLITE_MAX_SQL_LENGTH</a> </li><li> <a href="limits.html#max_variable_number">SQLITE_MAX_VARIABLE_NUMBER</a> </li></ul><a name="controlfeatures"></a><h2>1.3 Options To Control Operating Characteristics</h2><a name="os_other"></a><p><b>SQLITE_OS_OTHER=<i><0 or 1></i></b></p><blockquote><p> The option causes SQLite to omit its built-in operating system interfaces for Unix, Windows, and OS/2. The resulting library will have no default <a href="c3ref/vfs.html">operating system interface</a>. Applications must use <a href="c3ref/vfs_find.html">sqlite3_vfs_register()</a> to register an appropriate interface before using SQLite. Applications must also supply implementations for the <a href="c3ref/initialize.html">sqlite3_os_init()</a> and <a href="c3ref/initialize.html">sqlite3_os_end()</a> interfaces. The usual practice is for the supplied <a href="c3ref/initialize.html">sqlite3_os_init()</a> to invoke <a href="c3ref/vfs_find.html">sqlite3_vfs_register()</a>. SQLite will automatically invoke <a href="c3ref/initialize.html">sqlite3_os_init()</a> when it initializes.</p><p> This option is typically used when building SQLite for an embedded platform with a custom operating system.</p></blockquote><a name="secure_delete"></a><p><b>SQLITE_SECURE_DELETE</b></p><blockquote><p> This compile-time option causes SQLite to overwrite deleted information with zeros in addition to marking the space as available for reuse. Without this option, deleted data might be recoverable from a database using a binary editor. However, there is a performance penalty for using this option.</p><p> This option does <u>not</u> cause deleted data is securely removed from the underlying storage media.</p></blockquote><a name="threadsafe"></a>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -