mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 10:44:20 +01:00
core: Make strict schema support experimental
It's not tested properly so let's mark it as experimental for now. Fixes #2775
This commit is contained in:
11
cli/app.rs
11
cli/app.rs
@@ -66,6 +66,8 @@ pub struct Opts {
|
||||
pub experimental_views: bool,
|
||||
#[clap(long, help = "Enable experimental indexing feature")]
|
||||
pub experimental_indexes: Option<bool>,
|
||||
#[clap(long, help = "Enable experimental strict schema mode")]
|
||||
pub experimental_strict: bool,
|
||||
#[clap(short = 't', long, help = "specify output file for log traces")]
|
||||
pub tracing_output: Option<String>,
|
||||
#[clap(long, help = "Start MCP server instead of interactive shell")]
|
||||
@@ -107,6 +109,7 @@ impl Limbo {
|
||||
indexes_enabled,
|
||||
opts.experimental_mvcc,
|
||||
opts.experimental_views,
|
||||
opts.experimental_strict,
|
||||
)?
|
||||
} else {
|
||||
let flags = if opts.readonly {
|
||||
@@ -118,9 +121,11 @@ impl Limbo {
|
||||
&db_file,
|
||||
opts.vfs.as_ref(),
|
||||
flags,
|
||||
indexes_enabled,
|
||||
opts.experimental_mvcc,
|
||||
opts.experimental_views,
|
||||
turso_core::DatabaseOpts::new()
|
||||
.with_mvcc(opts.experimental_mvcc)
|
||||
.with_indexes(indexes_enabled)
|
||||
.with_views(opts.experimental_views)
|
||||
.with_strict(opts.experimental_strict),
|
||||
)?;
|
||||
let conn = db.connect()?;
|
||||
(io, conn)
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::sync::mpsc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use turso_core::{Connection, Database, OpenFlags, StepResult, Value as DbValue};
|
||||
use turso_core::{Connection, Database, DatabaseOpts, OpenFlags, StepResult, Value as DbValue};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
struct JsonRpcRequest {
|
||||
@@ -408,7 +408,7 @@ impl TursoMcpServer {
|
||||
|
||||
// Open the new database connection
|
||||
let conn = if path == ":memory:" || path.contains([':', '?', '&', '#']) {
|
||||
match Connection::from_uri(&path, true, false, false) {
|
||||
match Connection::from_uri(&path, true, false, false, false) {
|
||||
Ok((_io, c)) => c,
|
||||
Err(e) => return format!("Failed to open database '{path}': {e}"),
|
||||
}
|
||||
@@ -417,9 +417,7 @@ impl TursoMcpServer {
|
||||
&path,
|
||||
None::<&str>,
|
||||
OpenFlags::default(),
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
DatabaseOpts::new().with_indexes(true),
|
||||
) {
|
||||
Ok((_io, db)) => match db.connect() {
|
||||
Ok(c) => c,
|
||||
|
||||
Reference in New Issue
Block a user