diff --git a/src/ts_generator/sql_parser/expressions/translate_data_type.rs b/src/ts_generator/sql_parser/expressions/translate_data_type.rs index 5e6948ff..dfeb311a 100644 --- a/src/ts_generator/sql_parser/expressions/translate_data_type.rs +++ b/src/ts_generator/sql_parser/expressions/translate_data_type.rs @@ -138,7 +138,7 @@ pub fn translate_data_type(data_type: &DataType) -> TsFieldType { DataType::Datetime64(_, _) => TsFieldType::Date, DataType::Timestamp(_, _) => TsFieldType::String, DataType::TimestampNtz => TsFieldType::String, - DataType::Interval { .. } => TsFieldType::Any, + DataType::Interval { .. } => TsFieldType::Unknown, // JSON types DataType::JSON => TsFieldType::Object, @@ -151,9 +151,9 @@ pub fn translate_data_type(data_type: &DataType) -> TsFieldType { DataType::TsQuery => TsFieldType::String, // Complex types - DataType::Custom(_, _) => TsFieldType::Any, + DataType::Custom(_, _) => TsFieldType::Unknown, DataType::Array(array_element_type_def) => match array_element_type_def { - sqlparser::ast::ArrayElemTypeDef::None => TsFieldType::Array(Box::new(TsFieldType::Any)), + sqlparser::ast::ArrayElemTypeDef::None => TsFieldType::Array(Box::new(TsFieldType::Unknown)), sqlparser::ast::ArrayElemTypeDef::AngleBracket(data_type) => { TsFieldType::Array(Box::new(translate_data_type(data_type))) } @@ -177,8 +177,8 @@ pub fn translate_data_type(data_type: &DataType) -> TsFieldType { DataType::LowCardinality(inner_type) => translate_data_type(inner_type), // Special types - DataType::Unspecified => TsFieldType::Any, - DataType::Trigger => TsFieldType::Any, + DataType::Unspecified => TsFieldType::Unknown, + DataType::Trigger => TsFieldType::Unknown, DataType::AnyType => TsFieldType::Any, } } diff --git a/src/ts_generator/sql_parser/expressions/translate_expr.rs b/src/ts_generator/sql_parser/expressions/translate_expr.rs index d47ea135..d21cc2fe 100644 --- a/src/ts_generator/sql_parser/expressions/translate_expr.rs +++ b/src/ts_generator/sql_parser/expressions/translate_expr.rs @@ -480,13 +480,13 @@ pub async fn translate_expr( ts_query.insert_param(&inferred_type, &false, &Some(placeholder.to_string())) } Expr::JsonAccess { value: _, path: _ } => { - ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging)?; - ts_query.insert_param(&TsFieldType::Any, &false, &None) + ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging)?; + ts_query.insert_param(&TsFieldType::Unknown, &false, &None) } Expr::IsNotDistinctFrom(_, placeholder) | Expr::IsDistinctFrom(_, placeholder) => { // IsDistinctFrom and IsNotDistinctFrom are the same and can have a placeholder ts_query.insert_param(&TsFieldType::String, &false, &Some(placeholder.to_string()))?; - ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging) + ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging) } Expr::SimilarTo { negated: _, @@ -572,10 +572,12 @@ pub async fn translate_expr( ts_query.insert_result(alias, &[TsFieldType::String], is_selection, false, expr_for_logging) } Expr::Collate { expr: _, collation: _ } => { - ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging) + ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging) } - Expr::TypedString(_) => ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging), - Expr::Map(_) => ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging), + Expr::TypedString(_) => { + ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging) + } + Expr::Map(_) => ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging), // Note: AggregateExpressionWithFilter was removed in sqlparser 0.59.0 // Aggregate functions with filters are now part of the Function variant Expr::Case { @@ -584,7 +586,7 @@ pub async fn translate_expr( else_result: _, case_token: _, end_token: _, - } => ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging), + } => ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging), Expr::Exists { subquery, negated: _ } => { ts_query.insert_result(alias, &[TsFieldType::Boolean], is_selection, false, expr_for_logging)?; translate_query(ts_query, &None, subquery, db_conn, alias, false).await @@ -592,14 +594,14 @@ pub async fn translate_expr( // Note: ListAgg and ArrayAgg were removed in sqlparser 0.59.0 // They are now represented as Function variants Expr::GroupingSets(_) | Expr::Cube(_) | Expr::Rollup(_) | Expr::Tuple(_) | Expr::Array(_) => { - ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging) + ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging) } // Note: ArrayIndex was replaced with CompoundFieldAccess in sqlparser 0.59.0 // CompoundFieldAccess handles array indexing, map access, and composite field access Expr::CompoundFieldAccess { root: _, access_chain: _, - } => ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging), + } => ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging), Expr::Interval(_) => ts_query.insert_result(alias, &[TsFieldType::Number], is_selection, false, expr_for_logging), Expr::MatchAgainst { columns: _, @@ -704,7 +706,13 @@ pub async fn translate_expr( } // Fallback to Any if we couldn't infer the type - return ts_query.insert_result(Some(alias), &[TsFieldType::Any], is_selection, false, expr_for_logging); + return ts_query.insert_result( + Some(alias), + &[TsFieldType::Unknown], + is_selection, + false, + expr_for_logging, + ); } // Handle other function types @@ -733,7 +741,13 @@ pub async fn translate_expr( expr_for_logging, )?; } else { - ts_query.insert_result(Some(alias), &[TsFieldType::Any], is_selection, false, expr_for_logging)?; + ts_query.insert_result( + Some(alias), + &[TsFieldType::Unknown], + is_selection, + false, + expr_for_logging, + )?; } Ok(()) @@ -766,8 +780,8 @@ pub async fn translate_expr( expr: _, array_expr: _, negated: _, - } => ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging), - _ => ts_query.insert_result(alias, &[TsFieldType::Any], is_selection, false, expr_for_logging), + } => ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging), + _ => ts_query.insert_result(alias, &[TsFieldType::Unknown], is_selection, false, expr_for_logging), } } diff --git a/src/ts_generator/types/ts_query.rs b/src/ts_generator/types/ts_query.rs index 9fb93bef..a2997fa8 100644 --- a/src/ts_generator/types/ts_query.rs +++ b/src/ts_generator/types/ts_query.rs @@ -20,6 +20,7 @@ pub enum TsFieldType { Null, Enum(Vec), Any, + Unknown, #[allow(dead_code)] Array2D(Array2DContent), Array(Box), @@ -38,6 +39,7 @@ impl fmt::Display for TsFieldType { TsFieldType::Any => write!(f, "any"), TsFieldType::Null => write!(f, "null"), TsFieldType::Never => write!(f, "never"), + TsFieldType::Unknown => write!(f, "unknown"), TsFieldType::Array(ts_field_type) => { let ts_field_type = ts_field_type.clone(); let ts_field_type = *ts_field_type; @@ -90,7 +92,7 @@ impl TsFieldType { "character" | "character varying" | "bytea" | "uuid" | "text" => Self::String, "boolean" => Self::Boolean, "json" | "jsonb" => Self::Object, - "ARRAY" | "array" => Self::Any, + "ARRAY" | "array" => Self::Unknown, "date" => Self::Date, "USER-DEFINED" => { if let Some(enum_values) = enum_values { @@ -98,9 +100,9 @@ impl TsFieldType { } let warning_message = format!("Failed to find enum values for field {field_name} of table {table_name}"); warning!(warning_message); - Self::Any + Self::Unknown } - _ => Self::Any, + _ => Self::Unknown, } } @@ -122,9 +124,9 @@ impl TsFieldType { let warning_message = format!("Failed to find enum values for field {field_name} of table {table_name}"); warning!(warning_message); - Self::Any + Self::Unknown } - _ => Self::Any, + _ => Self::Unknown, } } @@ -140,7 +142,7 @@ impl TsFieldType { } else if annotated_type == "null" { return Self::Null; } - Self::Any + Self::Unknown } /// Converts a sqlparser DataType from table alias column definitions to TsFieldType diff --git a/tests/demo/aggregate_functions/basic_aggregates.queries.ts b/tests/demo/aggregate_functions/basic_aggregates.queries.ts index 132928b7..189ad24d 100644 --- a/tests/demo/aggregate_functions/basic_aggregates.queries.ts +++ b/tests/demo/aggregate_functions/basic_aggregates.queries.ts @@ -45,8 +45,8 @@ export type StddevAndVarianceParams = []; export interface IStddevAndVarianceResult { rarity: string | null; - stddevId: any; - varianceId: any; + stddevId: unknown; + varianceId: unknown; } export interface IStddevAndVarianceQuery { diff --git a/tests/demo/aggregate_functions/basic_aggregates.snapshot.ts b/tests/demo/aggregate_functions/basic_aggregates.snapshot.ts index 09b50977..9b2bbf3f 100644 --- a/tests/demo/aggregate_functions/basic_aggregates.snapshot.ts +++ b/tests/demo/aggregate_functions/basic_aggregates.snapshot.ts @@ -45,8 +45,8 @@ export type StddevAndVarianceParams = []; export interface IStddevAndVarianceResult { rarity: string | null; - stddevId: any; - varianceId: any; + stddevId: unknown; + varianceId: unknown; } export interface IStddevAndVarianceQuery { diff --git a/tests/demo/case_expressions/case_in_clauses.queries.ts b/tests/demo/case_expressions/case_in_clauses.queries.ts index fc815992..4f1f6e58 100644 --- a/tests/demo/case_expressions/case_in_clauses.queries.ts +++ b/tests/demo/case_expressions/case_in_clauses.queries.ts @@ -28,7 +28,7 @@ export type CaseInGroupByHavingParams = []; export interface ICaseInGroupByHavingResult { count: number; - rarityGroup: any; + rarityGroup: unknown; } export interface ICaseInGroupByHavingQuery { diff --git a/tests/demo/case_expressions/case_in_clauses.snapshot.ts b/tests/demo/case_expressions/case_in_clauses.snapshot.ts index fc02d165..4bb7203a 100644 --- a/tests/demo/case_expressions/case_in_clauses.snapshot.ts +++ b/tests/demo/case_expressions/case_in_clauses.snapshot.ts @@ -28,7 +28,7 @@ export type CaseInGroupByHavingParams = []; export interface ICaseInGroupByHavingResult { count: number; - rarityGroup: any; + rarityGroup: unknown; } export interface ICaseInGroupByHavingQuery { diff --git a/tests/demo/case_expressions/nested_case.queries.ts b/tests/demo/case_expressions/nested_case.queries.ts index 73844a62..d3c396a2 100644 --- a/tests/demo/case_expressions/nested_case.queries.ts +++ b/tests/demo/case_expressions/nested_case.queries.ts @@ -1,7 +1,7 @@ export type NestedCaseBasicParams = []; export interface INestedCaseBasicResult { - detailedRarity: any; + detailedRarity: unknown; id: number; name: string; rarity: string | null; @@ -17,7 +17,7 @@ export type NestedCaseMultipleLevelsParams = []; export interface INestedCaseMultipleLevelsResult { id: number; name: string; - tier: any; + tier: unknown; } export interface INestedCaseMultipleLevelsQuery { diff --git a/tests/demo/case_expressions/nested_case.snapshot.ts b/tests/demo/case_expressions/nested_case.snapshot.ts index 1a693ae3..4ecb2508 100644 --- a/tests/demo/case_expressions/nested_case.snapshot.ts +++ b/tests/demo/case_expressions/nested_case.snapshot.ts @@ -1,7 +1,7 @@ export type NestedCaseBasicParams = []; export interface INestedCaseBasicResult { - detailedRarity: any; + detailedRarity: unknown; id: number; name: string; rarity: string | null; @@ -17,7 +17,7 @@ export type NestedCaseMultipleLevelsParams = []; export interface INestedCaseMultipleLevelsResult { id: number; name: string; - tier: any; + tier: unknown; } export interface INestedCaseMultipleLevelsQuery { diff --git a/tests/demo/case_expressions/searched_case.queries.ts b/tests/demo/case_expressions/searched_case.queries.ts index b83e8e6f..eae425a0 100644 --- a/tests/demo/case_expressions/searched_case.queries.ts +++ b/tests/demo/case_expressions/searched_case.queries.ts @@ -2,7 +2,7 @@ export type SearchedCaseBasicParams = []; export interface ISearchedCaseBasicResult { id: number; - idCategory: any; + idCategory: unknown; name: string; } @@ -15,7 +15,7 @@ export type SearchedCaseMultipleConditionsParams = []; export interface ISearchedCaseMultipleConditionsResult { id: number; - itemClass: any; + itemClass: unknown; name: string; rarity: string | null; } @@ -30,7 +30,7 @@ export type SearchedCaseWithParamsParams = []; export interface ISearchedCaseWithParamsResult { id: number; name: string; - thresholdStatus: any; + thresholdStatus: unknown; } export interface ISearchedCaseWithParamsQuery { diff --git a/tests/demo/case_expressions/searched_case.snapshot.ts b/tests/demo/case_expressions/searched_case.snapshot.ts index 74d61e67..a648ec6c 100644 --- a/tests/demo/case_expressions/searched_case.snapshot.ts +++ b/tests/demo/case_expressions/searched_case.snapshot.ts @@ -2,7 +2,7 @@ export type SearchedCaseBasicParams = []; export interface ISearchedCaseBasicResult { id: number; - idCategory: any; + idCategory: unknown; name: string; } @@ -15,7 +15,7 @@ export type SearchedCaseMultipleConditionsParams = []; export interface ISearchedCaseMultipleConditionsResult { id: number; - itemClass: any; + itemClass: unknown; name: string; rarity: string | null; } @@ -30,7 +30,7 @@ export type SearchedCaseWithParamsParams = []; export interface ISearchedCaseWithParamsResult { id: number; name: string; - thresholdStatus: any; + thresholdStatus: unknown; } export interface ISearchedCaseWithParamsQuery { diff --git a/tests/demo/case_expressions/simple_case.queries.ts b/tests/demo/case_expressions/simple_case.queries.ts index 072984cd..b08db50d 100644 --- a/tests/demo/case_expressions/simple_case.queries.ts +++ b/tests/demo/case_expressions/simple_case.queries.ts @@ -3,7 +3,7 @@ export type SimpleCaseBasicParams = []; export interface ISimpleCaseBasicResult { id: number; name: string; - rarityCode: any; + rarityCode: unknown; } export interface ISimpleCaseBasicQuery { @@ -16,7 +16,7 @@ export type SimpleCaseWithNullParams = []; export interface ISimpleCaseWithNullResult { id: number; name: string; - rarityLevel: any; + rarityLevel: unknown; } export interface ISimpleCaseWithNullQuery { @@ -28,9 +28,9 @@ export type MultipleCaseExpressionsParams = []; export interface IMultipleCaseExpressionsResult { id: number; - idRange: any; + idRange: unknown; name: string; - rarityTier: any; + rarityTier: unknown; } export interface IMultipleCaseExpressionsQuery { diff --git a/tests/demo/case_expressions/simple_case.snapshot.ts b/tests/demo/case_expressions/simple_case.snapshot.ts index afcae4b9..307fa0d2 100644 --- a/tests/demo/case_expressions/simple_case.snapshot.ts +++ b/tests/demo/case_expressions/simple_case.snapshot.ts @@ -3,7 +3,7 @@ export type SimpleCaseBasicParams = []; export interface ISimpleCaseBasicResult { id: number; name: string; - rarityCode: any; + rarityCode: unknown; } export interface ISimpleCaseBasicQuery { @@ -16,7 +16,7 @@ export type SimpleCaseWithNullParams = []; export interface ISimpleCaseWithNullResult { id: number; name: string; - rarityLevel: any; + rarityLevel: unknown; } export interface ISimpleCaseWithNullQuery { @@ -28,9 +28,9 @@ export type MultipleCaseExpressionsParams = []; export interface IMultipleCaseExpressionsResult { id: number; - idRange: any; + idRange: unknown; name: string; - rarityTier: any; + rarityTier: unknown; } export interface IMultipleCaseExpressionsQuery { diff --git a/tests/demo/datetime_functions/date_functions.queries.ts b/tests/demo/datetime_functions/date_functions.queries.ts index de63b1a9..e2e15d3b 100644 --- a/tests/demo/datetime_functions/date_functions.queries.ts +++ b/tests/demo/datetime_functions/date_functions.queries.ts @@ -59,7 +59,7 @@ export interface IAgeFunctionQuery { export type DateArithmeticParams = []; export interface IDateArithmeticResult { - createdAt: any | null; + createdAt: unknown | null; id: number; name: string; oneMonthAgo: number; diff --git a/tests/demo/datetime_functions/date_functions.snapshot.ts b/tests/demo/datetime_functions/date_functions.snapshot.ts index 6b90b726..4bb7f773 100644 --- a/tests/demo/datetime_functions/date_functions.snapshot.ts +++ b/tests/demo/datetime_functions/date_functions.snapshot.ts @@ -59,7 +59,7 @@ export interface IAgeFunctionQuery { export type DateArithmeticParams = []; export interface IDateArithmeticResult { - createdAt: any | null; + createdAt: unknown | null; id: number; name: string; oneMonthAgo: number; diff --git a/tests/demo/datetime_functions/time_functions.queries.ts b/tests/demo/datetime_functions/time_functions.queries.ts index f81a465d..672ce3d2 100644 --- a/tests/demo/datetime_functions/time_functions.queries.ts +++ b/tests/demo/datetime_functions/time_functions.queries.ts @@ -16,8 +16,8 @@ export type TimeComparisonParams = []; export interface ITimeComparisonResult { id: number; - loginTime: any | null; - logoutTime: any | null; + loginTime: unknown | null; + logoutTime: unknown | null; name: string; } @@ -29,7 +29,7 @@ export interface ITimeComparisonQuery { export type IntervalOperationsParams = []; export interface IIntervalOperationsResult { - createdAt: any | null; + createdAt: unknown | null; id: number; name: string; oneHourLater: number; @@ -46,7 +46,7 @@ export type DateDifferenceParams = []; export interface IDateDifferenceResult { id: number; name: string; - sessionDuration: any | null; + sessionDuration: unknown | null; } export interface IDateDifferenceQuery { diff --git a/tests/demo/datetime_functions/time_functions.snapshot.ts b/tests/demo/datetime_functions/time_functions.snapshot.ts index 1b429a85..f6c1d6aa 100644 --- a/tests/demo/datetime_functions/time_functions.snapshot.ts +++ b/tests/demo/datetime_functions/time_functions.snapshot.ts @@ -16,8 +16,8 @@ export type TimeComparisonParams = []; export interface ITimeComparisonResult { id: number; - loginTime: any | null; - logoutTime: any | null; + loginTime: unknown | null; + logoutTime: unknown | null; name: string; } @@ -29,7 +29,7 @@ export interface ITimeComparisonQuery { export type IntervalOperationsParams = []; export interface IIntervalOperationsResult { - createdAt: any | null; + createdAt: unknown | null; id: number; name: string; oneHourLater: number; @@ -46,7 +46,7 @@ export type DateDifferenceParams = []; export interface IDateDifferenceResult { id: number; name: string; - sessionDuration: any | null; + sessionDuration: unknown | null; } export interface IDateDifferenceQuery { diff --git a/tests/demo/postgres/array_operations.queries.ts b/tests/demo/postgres/array_operations.queries.ts index eb315b93..4cdf1132 100644 --- a/tests/demo/postgres/array_operations.queries.ts +++ b/tests/demo/postgres/array_operations.queries.ts @@ -1,7 +1,7 @@ export type ArrayAggBasicParams = []; export interface IArrayAggBasicResult { - names: any; + names: unknown; rarity: string | null; } @@ -13,7 +13,7 @@ export interface IArrayAggBasicQuery { export type ArrayAggWithOrderByParams = []; export interface IArrayAggWithOrderByResult { - namesOrdered: any; + namesOrdered: unknown; rarity: string | null; } @@ -22,17 +22,17 @@ export interface IArrayAggWithOrderByQuery { result: IArrayAggWithOrderByResult; } -export type ArrayLiteralAnyParams = []; +export type ArrayLiteralUnknownParams = []; -export interface IArrayLiteralAnyResult { +export interface IArrayLiteralUnknownResult { id: number; name: string; rarity: string | null; } -export interface IArrayLiteralAnyQuery { - params: ArrayLiteralAnyParams; - result: IArrayLiteralAnyResult; +export interface IArrayLiteralUnknownQuery { + params: ArrayLiteralUnknownParams; + result: IArrayLiteralUnknownResult; } export type ArrayWithParamsParams = [Array]; diff --git a/tests/demo/postgres/array_operations.snapshot.ts b/tests/demo/postgres/array_operations.snapshot.ts index c9f2fa98..458b58b2 100644 --- a/tests/demo/postgres/array_operations.snapshot.ts +++ b/tests/demo/postgres/array_operations.snapshot.ts @@ -1,7 +1,7 @@ export type ArrayAggBasicParams = []; export interface IArrayAggBasicResult { - names: any; + names: unknown; rarity: string | null; } @@ -13,7 +13,7 @@ export interface IArrayAggBasicQuery { export type ArrayAggWithOrderByParams = []; export interface IArrayAggWithOrderByResult { - namesOrdered: any; + namesOrdered: unknown; rarity: string | null; } @@ -22,17 +22,17 @@ export interface IArrayAggWithOrderByQuery { result: IArrayAggWithOrderByResult; } -export type ArrayLiteralAnyParams = []; +export type ArrayLiteralUnknownParams = []; -export interface IArrayLiteralAnyResult { +export interface IArrayLiteralUnknownResult { id: number; name: string; rarity: string | null; } -export interface IArrayLiteralAnyQuery { - params: ArrayLiteralAnyParams; - result: IArrayLiteralAnyResult; +export interface IArrayLiteralUnknownQuery { + params: ArrayLiteralUnknownParams; + result: IArrayLiteralUnknownResult; } export type ArrayWithParamsParams = [Array]; diff --git a/tests/demo/postgres/array_operations.ts b/tests/demo/postgres/array_operations.ts index 0fae2d29..5d616cf0 100644 --- a/tests/demo/postgres/array_operations.ts +++ b/tests/demo/postgres/array_operations.ts @@ -20,9 +20,9 @@ FROM items GROUP BY rarity ` -// Array literal and ANY -const arrayLiteralAny = sql` --- @name: array literal any +// Array literal and unknown +const arrayLiteralunknown = sql` +-- @name: array literal unknown SELECT id, name, rarity FROM items WHERE rarity = ANY(ARRAY['common', 'rare']) diff --git a/tests/demo/postgres/jsonb_operations.queries.ts b/tests/demo/postgres/jsonb_operations.queries.ts index 42ab19cd..169bd620 100644 --- a/tests/demo/postgres/jsonb_operations.queries.ts +++ b/tests/demo/postgres/jsonb_operations.queries.ts @@ -2,7 +2,7 @@ export type JsonbBuildObjectBasicParams = []; export interface IJsonbBuildObjectBasicResult { id: number; - itemJson: any; + itemJson: unknown; } export interface IJsonbBuildObjectBasicQuery { @@ -13,7 +13,7 @@ export interface IJsonbBuildObjectBasicQuery { export type JsonbAggregationParams = []; export interface IJsonbAggregationResult { - items: any; + items: unknown; rarity: string | null; } diff --git a/tests/demo/postgres/jsonb_operations.snapshot.ts b/tests/demo/postgres/jsonb_operations.snapshot.ts index ac767890..8ac732d9 100644 --- a/tests/demo/postgres/jsonb_operations.snapshot.ts +++ b/tests/demo/postgres/jsonb_operations.snapshot.ts @@ -2,7 +2,7 @@ export type JsonbBuildObjectBasicParams = []; export interface IJsonbBuildObjectBasicResult { id: number; - itemJson: any; + itemJson: unknown; } export interface IJsonbBuildObjectBasicQuery { @@ -13,7 +13,7 @@ export interface IJsonbBuildObjectBasicQuery { export type JsonbAggregationParams = []; export interface IJsonbAggregationResult { - items: any; + items: unknown; rarity: string | null; } diff --git a/tests/demo/select/no-default-table.queries.ts b/tests/demo/select/no-default-table.queries.ts index 7ae64d07..c702e0c3 100644 --- a/tests/demo/select/no-default-table.queries.ts +++ b/tests/demo/select/no-default-table.queries.ts @@ -69,11 +69,11 @@ export interface IAllStringsResult { extractMonth1: Date; extractSecond1: Date; extractYear1: Date; - jsonArray1: any; - jsonBuildObject1: any; + jsonArray1: unknown; + jsonBuildObject1: unknown; jsonExtractPathText1: string; - jsonbArray1: any; - jsonbBuildObject1: any; + jsonbArray1: unknown; + jsonbBuildObject1: unknown; jsonbExtractPathText1: string; left1: string; length1: string; @@ -84,7 +84,7 @@ export interface IAllStringsResult { now1: string; octetLength1: string; position1: number; - random1: any; + random1: unknown; repeat1: string; replace1: string; reverse1: string; @@ -96,8 +96,8 @@ export interface IAllStringsResult { substring1: string; toChar1: string; toDate1: string; - toJson1: any; - toJsonb1: any; + toJson1: unknown; + toJsonb1: unknown; toTimestamp1: string; trim1: string; upper1: string; diff --git a/tests/demo/select/no-default-table.snapshot.ts b/tests/demo/select/no-default-table.snapshot.ts index dbc129c7..9d587158 100644 --- a/tests/demo/select/no-default-table.snapshot.ts +++ b/tests/demo/select/no-default-table.snapshot.ts @@ -69,11 +69,11 @@ export interface IAllStringsResult { extractMonth1: Date; extractSecond1: Date; extractYear1: Date; - jsonArray1: any; - jsonBuildObject1: any; + jsonArray1: unknown; + jsonBuildObject1: unknown; jsonExtractPathText1: string; - jsonbArray1: any; - jsonbBuildObject1: any; + jsonbArray1: unknown; + jsonbBuildObject1: unknown; jsonbExtractPathText1: string; left1: string; length1: string; @@ -84,7 +84,7 @@ export interface IAllStringsResult { now1: string; octetLength1: string; position1: number; - random1: any; + random1: unknown; repeat1: string; replace1: string; reverse1: string; @@ -96,8 +96,8 @@ export interface IAllStringsResult { substring1: string; toChar1: string; toDate1: string; - toJson1: any; - toJsonb1: any; + toJson1: unknown; + toJsonb1: unknown; toTimestamp1: string; trim1: string; upper1: string; diff --git a/tests/demo/select/select.queries.ts b/tests/demo/select/select.queries.ts index 1f58479d..fd7e931b 100644 --- a/tests/demo/select/select.queries.ts +++ b/tests/demo/select/select.queries.ts @@ -118,7 +118,7 @@ export interface ISelectSql10Query { export type SelectSql11Params = [string, string]; export interface ISelectSql11Result { - hmm: any; + hmm: unknown; id: number; quantity: number | null; } diff --git a/tests/demo/select/select.snapshot.ts b/tests/demo/select/select.snapshot.ts index 37fb9cfa..abd24930 100644 --- a/tests/demo/select/select.snapshot.ts +++ b/tests/demo/select/select.snapshot.ts @@ -118,7 +118,7 @@ export interface ISelectSql10Query { export type SelectSql11Params = [string, string]; export interface ISelectSql11Result { - hmm: any; + hmm: unknown; id: number; quantity: number | null; } diff --git a/tests/demo/typescript/expression/as_const.ts b/tests/demo/typescript/expression/as_const.ts index 17c4525a..5ea422ee 100644 --- a/tests/demo/typescript/expression/as_const.ts +++ b/tests/demo/typescript/expression/as_const.ts @@ -20,4 +20,4 @@ const nestedAsConst = { // as const with type assertion const asConstWithTypeAssertion = { query: sql`SELECT id, name FROM items` -} as const satisfies Record +} as const satisfies Record diff --git a/tests/demo/typescript/expression/types.ts b/tests/demo/typescript/expression/types.ts index 6802a9ea..cc97c7d2 100644 --- a/tests/demo/typescript/expression/types.ts +++ b/tests/demo/typescript/expression/types.ts @@ -30,7 +30,7 @@ module TestModule { const moduleSql = sql`SELECT id FROM items` } -let name: any = 'test' -let companyName = name +let name: unknown = 'test' +let compunknownName = name let partnerName = name as string let someName = 'test' as const