mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-06 09:44:21 +01:00
do not use Name::new
This commit is contained in:
@@ -236,7 +236,7 @@ impl Arbitrary for QualifiedName {
|
||||
// TODO: for now forego alias
|
||||
Self {
|
||||
db_name: None,
|
||||
name: Name::new(&table.name),
|
||||
name: Name::from_str(&table.name),
|
||||
alias: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ impl Predicate {
|
||||
Box::new(|_| {
|
||||
Some(Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::Equals,
|
||||
Box::new(Expr::Literal(value.into())),
|
||||
@@ -105,8 +105,8 @@ impl Predicate {
|
||||
} else {
|
||||
Some(Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::NotEquals,
|
||||
Box::new(Expr::Literal(v.into())),
|
||||
@@ -120,8 +120,8 @@ impl Predicate {
|
||||
let lt_value = LTValue::arbitrary_from(rng, context, value).0;
|
||||
Some(Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::Greater,
|
||||
Box::new(Expr::Literal(lt_value.into())),
|
||||
@@ -134,8 +134,8 @@ impl Predicate {
|
||||
let gt_value = GTValue::arbitrary_from(rng, context, value).0;
|
||||
Some(Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::Less,
|
||||
Box::new(Expr::Literal(gt_value.into())),
|
||||
@@ -149,8 +149,8 @@ impl Predicate {
|
||||
LikeValue::arbitrary_from_maybe(rng, context, value).map(|like| {
|
||||
Expr::Like {
|
||||
lhs: Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
not: false, // TODO: also generate this value eventually
|
||||
op: ast::LikeOperator::Like,
|
||||
@@ -199,8 +199,8 @@ impl Predicate {
|
||||
Box::new(|_| {
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::NotEquals,
|
||||
Box::new(Expr::Literal(value.into())),
|
||||
@@ -215,8 +215,8 @@ impl Predicate {
|
||||
};
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::Equals,
|
||||
Box::new(Expr::Literal(v.into())),
|
||||
@@ -226,8 +226,8 @@ impl Predicate {
|
||||
let gt_value = GTValue::arbitrary_from(rng, context, value).0;
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::Greater,
|
||||
Box::new(Expr::Literal(gt_value.into())),
|
||||
@@ -237,8 +237,8 @@ impl Predicate {
|
||||
let lt_value = LTValue::arbitrary_from(rng, context, value).0;
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(&table_name),
|
||||
ast::Name::new(&column.name),
|
||||
ast::Name::from_str(&table_name),
|
||||
ast::Name::from_str(&column.name),
|
||||
)),
|
||||
ast::Operator::Less,
|
||||
Box::new(Expr::Literal(lt_value.into())),
|
||||
@@ -275,8 +275,8 @@ impl SimplePredicate {
|
||||
Box::new(|_rng| {
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(table_name),
|
||||
ast::Name::new(&column.column.name),
|
||||
ast::Name::from_str(table_name),
|
||||
ast::Name::from_str(&column.column.name),
|
||||
)),
|
||||
ast::Operator::Equals,
|
||||
Box::new(Expr::Literal(column_value.into())),
|
||||
@@ -286,8 +286,8 @@ impl SimplePredicate {
|
||||
let lt_value = LTValue::arbitrary_from(rng, context, column_value).0;
|
||||
Expr::Binary(
|
||||
Box::new(Expr::Qualified(
|
||||
ast::Name::new(table_name),
|
||||
ast::Name::new(&column.column.name),
|
||||
ast::Name::from_str(table_name),
|
||||
ast::Name::from_str(&column.column.name),
|
||||
)),
|
||||
ast::Operator::Greater,
|
||||
Box::new(Expr::Literal(lt_value.into())),
|
||||
@@ -297,8 +297,8 @@ impl SimplePredicate {
|
||||
let gt_value = GTValue::arbitrary_from(rng, context, column_value).0;
|
||||
Expr::Binary(
|
||||
Box::new(Expr::Qualified(
|
||||
ast::Name::new(table_name),
|
||||
ast::Name::new(&column.column.name),
|
||||
ast::Name::from_str(table_name),
|
||||
ast::Name::from_str(&column.column.name),
|
||||
)),
|
||||
ast::Operator::Less,
|
||||
Box::new(Expr::Literal(gt_value.into())),
|
||||
@@ -333,8 +333,8 @@ impl SimplePredicate {
|
||||
Box::new(|_rng| {
|
||||
Expr::Binary(
|
||||
Box::new(Expr::Qualified(
|
||||
ast::Name::new(table_name),
|
||||
ast::Name::new(&column.column.name),
|
||||
ast::Name::from_str(table_name),
|
||||
ast::Name::from_str(&column.column.name),
|
||||
)),
|
||||
ast::Operator::NotEquals,
|
||||
Box::new(Expr::Literal(column_value.into())),
|
||||
@@ -344,8 +344,8 @@ impl SimplePredicate {
|
||||
let gt_value = GTValue::arbitrary_from(rng, context, column_value).0;
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(table_name),
|
||||
ast::Name::new(&column.column.name),
|
||||
ast::Name::from_str(table_name),
|
||||
ast::Name::from_str(&column.column.name),
|
||||
)),
|
||||
ast::Operator::Greater,
|
||||
Box::new(Expr::Literal(gt_value.into())),
|
||||
@@ -355,8 +355,8 @@ impl SimplePredicate {
|
||||
let lt_value = LTValue::arbitrary_from(rng, context, column_value).0;
|
||||
Expr::Binary(
|
||||
Box::new(ast::Expr::Qualified(
|
||||
ast::Name::new(table_name),
|
||||
ast::Name::new(&column.column.name),
|
||||
ast::Name::from_str(table_name),
|
||||
ast::Name::from_str(&column.column.name),
|
||||
)),
|
||||
ast::Operator::Less,
|
||||
Box::new(Expr::Literal(lt_value.into())),
|
||||
|
||||
Reference in New Issue
Block a user