mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 13:58:55 +08:00 
			
		
		
		
	
							
								
								
									
										5
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							| @@ -32,8 +32,9 @@ jobs: | |||||||
|           profile: minimal |           profile: minimal | ||||||
|           toolchain: stable |           toolchain: stable | ||||||
|           override: true |           override: true | ||||||
|       - run: cargo build --features bundled |       - run: cargo build --features bundled --workspace --all-targets | ||||||
|       - run: cargo test --features bundled |       - run: cargo test --features bundled --workspace --all-targets | ||||||
|  |       - run: cargo test --features bundled --workspace --doc | ||||||
|       - name: Static build |       - name: Static build | ||||||
|         if: matrix.platform.os == 'windows-latest' |         if: matrix.platform.os == 'windows-latest' | ||||||
|         shell: cmd |         shell: cmd | ||||||
|   | |||||||
| @@ -56,6 +56,7 @@ series = ["vtab"] | |||||||
| # check for invalid query. | # check for invalid query. | ||||||
| extra_check = [] | extra_check = [] | ||||||
| modern_sqlite = ["libsqlite3-sys/bundled_bindings"] | modern_sqlite = ["libsqlite3-sys/bundled_bindings"] | ||||||
|  | unstable = [] | ||||||
|  |  | ||||||
| [dependencies] | [dependencies] | ||||||
| time = "0.1.0" | time = "0.1.0" | ||||||
| @@ -73,6 +74,7 @@ memchr = "2.2.0" | |||||||
| uuid = { version = "0.8", optional = true } | uuid = { version = "0.8", optional = true } | ||||||
|  |  | ||||||
| [dev-dependencies] | [dev-dependencies] | ||||||
|  | doc-comment = "0.3" | ||||||
| tempfile = "3.1.0" | tempfile = "3.1.0" | ||||||
| lazy_static = "1.0" | lazy_static = "1.0" | ||||||
| regex = "1.0" | regex = "1.0" | ||||||
|   | |||||||
| @@ -122,7 +122,7 @@ You can adjust this behavior in a number of ways: | |||||||
|   link against that. This source is embedded in the `libsqlite3-sys` crate and |   link against that. This source is embedded in the `libsqlite3-sys` crate and | ||||||
|   is currently SQLite 3.30.1 (as of `rusqlite` 0.21.0 / `libsqlite3-sys` |   is currently SQLite 3.30.1 (as of `rusqlite` 0.21.0 / `libsqlite3-sys` | ||||||
|   0.17.0).  This is probably the simplest solution to any build problems. You can enable this by adding the following in your `Cargo.toml` file: |   0.17.0).  This is probably the simplest solution to any build problems. You can enable this by adding the following in your `Cargo.toml` file: | ||||||
|   ``` |   ```toml | ||||||
|   [dependencies.rusqlite] |   [dependencies.rusqlite] | ||||||
|   version = "0.21.0" |   version = "0.21.0" | ||||||
|   features = ["bundled"] |   features = ["bundled"] | ||||||
|   | |||||||
| @@ -1,20 +1,24 @@ | |||||||
| #![feature(test)] | #![cfg_attr(feature = "unstable", feature(test))] | ||||||
| extern crate test; |  | ||||||
|  |  | ||||||
| use rusqlite::Connection; | #[cfg(feature = "unstable")] | ||||||
| use test::Bencher; | mod bench { | ||||||
|  |     extern crate test; | ||||||
|  |  | ||||||
| #[bench] |     use rusqlite::Connection; | ||||||
| fn bench_no_cache(b: &mut Bencher) { |     use test::Bencher; | ||||||
|  |  | ||||||
|  |     #[bench] | ||||||
|  |     fn bench_no_cache(b: &mut Bencher) { | ||||||
|         let db = Connection::open_in_memory().unwrap(); |         let db = Connection::open_in_memory().unwrap(); | ||||||
|         db.set_prepared_statement_cache_capacity(0); |         db.set_prepared_statement_cache_capacity(0); | ||||||
|         let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71"; |         let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71"; | ||||||
|         b.iter(|| db.prepare(sql).unwrap()); |         b.iter(|| db.prepare(sql).unwrap()); | ||||||
| } |     } | ||||||
|  |  | ||||||
| #[bench] |     #[bench] | ||||||
| fn bench_cache(b: &mut Bencher) { |     fn bench_cache(b: &mut Bencher) { | ||||||
|         let db = Connection::open_in_memory().unwrap(); |         let db = Connection::open_in_memory().unwrap(); | ||||||
|         let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71"; |         let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71"; | ||||||
|         b.iter(|| db.prepare_cached(sql).unwrap()); |         b.iter(|| db.prepare_cached(sql).unwrap()); | ||||||
|  |     } | ||||||
| } | } | ||||||
| @@ -900,6 +900,9 @@ unsafe fn db_filename(_: *mut ffi::sqlite3) -> Option<PathBuf> { | |||||||
|     None |     None | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #[cfg(doctest)] | ||||||
|  | doc_comment::doctest!("../README.md"); | ||||||
|  |  | ||||||
| #[cfg(test)] | #[cfg(test)] | ||||||
| mod test { | mod test { | ||||||
|     use super::*; |     use super::*; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user