()
| 92 | /// `'userId'` is a single-quoted string literal. |
| 93 | #[test] |
| 94 | fn single_quoted_is_string_literal() { |
| 95 | let expr = first_select_expr("SELECT 'userId' FROM users"); |
| 96 | match &expr { |
| 97 | Expr::Value(v) => match &v.value { |
| 98 | Value::SingleQuotedString(s) => assert_eq!(s, "userId"), |
| 99 | other => panic!("expected SingleQuotedString, got {other:?}"), |
| 100 | }, |
| 101 | other => panic!("expected Value, got {other:?}"), |
| 102 | } |
| 103 | // And convert_value maps it to SqlValue::String. |
| 104 | let Expr::Value(v) = expr else { unreachable!() }; |
| 105 | assert!(matches!( |
| 106 | convert_value(&v.value), |
| 107 | Ok(SqlValue::String(s)) if s == "userId" |
| 108 | )); |
| 109 | } |
| 110 | |
| 111 | /// `Value::DoubleQuotedString` (non-Postgres dialect) falls through |
| 112 | /// `convert_value` to `SqlError::Unsupported`. With PostgreSQL dialect |
nothing calls this directly
no test coverage detected