MCPcopy Index your code

hub / github.com/JasonShin/sqlx-ts / functions

Functions287 in github.com/JasonShin/sqlx-ts

↓ 495 callersFunctionsql
(query: T)
node/src/index.ts:1
↓ 64 callersMethodmap
(fn: (value: T) => U)
tests/demo/typescript/expression/method_chain.ts:15
↓ 45 callersMethodinsert_result
inserts a value into the result hashmap it should only insert a value if you are working with a non-subquery queries
src/ts_generator/types/ts_query.rs:426
↓ 23 callersMethodinsert_param
Inserts a parameter into TsQuery for type definition generation If you pass in the order argument, it will use the manually passed in order It's impor
src/ts_generator/types/ts_query.rs:509
↓ 12 callersFunctionget_sql_from_expr
( sqls: &mut Vec<SQL>, var_decl_name: &Option<String>, expr: &Expr, span: &MultiSpan, import_alias:
src/parser/tag.rs:46
↓ 11 callersMethodfetch_table
fetch table's column details from information_schema of each database type # MySQL Notes - TABLE_SCHEMA in MySQL is basically the `database_name`, so
src/ts_generator/information_schema.rs:47
↓ 10 callersFunctionget_default_table
(table_with_joins: &[TableWithJoins])
src/ts_generator/sql_parser/expressions/translate_table_with_joins.rs:28
↓ 9 callersFunctionrecurse_and_find_sql
(sqls: &mut Vec<SQL>, stmt: &Stmt, import_alias: &String)
src/parser/js_parser.rs:44
↓ 9 callersFunctiontranslate_expr
( expr: &Expr, single_table_name: &Option<&str>, table_with_joins: &Option<Vec<TableWithJoins>>, alias
src/ts_generator/sql_parser/expressions/translate_expr.rs:216
↓ 8 callersMethodpipe
(fn: (value: T) => U)
tests/demo/typescript/expression/method_chain.ts:11
↓ 8 callersFunctiontranslate_query
( ts_query: &mut TsQuery, // this parameter is used to stack table_with_joins while recursing through subq
src/ts_generator/sql_parser/translate_query.rs:200
↓ 7 callersMethodflatten
(&self)
test-utils/src/lib.rs:11
↓ 7 callersFunctioninfo
(msg)
node/postinstall.js:20
↓ 7 callersFunctionprocess_block_stmt_as_expr
The method process block statement as expression It receives a block statement object from Class expression inserts the sqls into the sqls vector
src/parser/tag.rs:9
↓ 7 callersMethodsucceed
(value: T)
tests/demo/typescript/expression/method_chain.ts:5
↓ 6 callersFunctionget_sql_query_param_directed
Internal helper that checks a specific direction: column_expr for column name, placeholder_expr for placeholder
src/ts_generator/sql_parser/expressions/translate_expr.rs:150
↓ 5 callersFunctionparse_table_name
(sql: &str)
src/ts_generator/sql_parser/quoted_strings.rs:68
↓ 5 callersFunctiontranslate_stmt
( ts_query: &mut TsQuery, sql_statement: &Statement, alias: Option<&str>, // If the statement is origina
src/ts_generator/sql_parser/translate_stmt.rs:16
↓ 5 callersFunctiontranslate_table_with_joins
Translates a select item's target table by looking for TableWithJoins If the select item uses table alias, it should find the table name using the ali
src/ts_generator/sql_parser/expressions/translate_table_with_joins.rs:239
↓ 4 callersFunctionfind_table_name_from_identifier
( table_with_joins: &[TableWithJoins], identifiers: &[String], // can be the actual identifier or an alias
src/ts_generator/sql_parser/expressions/translate_table_with_joins.rs:61
↓ 4 callersFunctionget_expr_placeholder
Given an expression e.g. WHERE some_column = ? e.g. WHERE some_table.some_column = ? it should receive `?` or `$1` and determine that it is a placeh
src/ts_generator/sql_parser/expressions/translate_expr.rs:45
↓ 4 callersFunctionis_date_function
(func_name: &str)
src/ts_generator/sql_parser/expressions/functions.rs:152
↓ 4 callersFunctionis_numeric_function
(func_name: &str)
src/ts_generator/sql_parser/expressions/functions.rs:144
↓ 4 callersFunctionis_string_function
(func_name: &str)
src/ts_generator/sql_parser/expressions/functions.rs:148
↓ 4 callersFunctionis_type_polymorphic_function
(func_name: &str)
src/ts_generator/sql_parser/expressions/functions.rs:170
↓ 4 callersFunctionrun_sqlite_test
Helper: creates a temporary SQLite database with the given schema, then runs sqlx-ts on the given TS content, and returns the generated types.
tests/sqlite_query_parameters.rs:14
↓ 4 callersFunctiontranslate_table_from_expr
The function takes in an expression such as Example 1: given `SELECT id FROM items` expression is `id`
src/ts_generator/sql_parser/expressions/translate_table_with_joins.rs:178
↓ 3 callersFunctiongenerate_ts_interface
(sql: &SQL, db_conn: &DBConn)
src/ts_generator/generator.rs:123
↓ 3 callersFunctionprepare
Runs the prepare statement on the input SQL. Validates the query is right by directly connecting to the configured database. It also processes ts inte
src/core/mysql/prepare.rs:13
↓ 3 callersFunctionrun_demo_test
(demo_path: &Path)
tests/demo_happy_path.rs:13
↓ 3 callersFunctionsafeUnlink
(filePath)
node/postinstall.js:58
↓ 3 callersFunctiontest
()
tests/demo/typescript/statement/function.ts:3
↓ 3 callersFunctiontranslate_insert_returning
( ts_query: &mut TsQuery, returning: &Vec<SelectItem>, table_name: &str, conn: &DBConn, query_for_lo
src/ts_generator/sql_parser/translate_insert.rs:126
↓ 3 callersFunctiontranslate_value
(value: &Value)
src/ts_generator/sql_parser/expressions/translate_data_type.rs:5
↓ 3 callersFunctiontrim_table_name
(val: &String, quote_style: &Option<char>)
src/ts_generator/sql_parser/quoted_strings.rs:5
↓ 2 callersFunctiondownloadFile
(url, destination, redirectCount = 0)
node/postinstall.js:69
↓ 2 callersFunctionerror
(msg)
node/postinstall.js:23
↓ 2 callersFunctionextract_expr_from_arg
Extract expression from a function argument
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs:23
↓ 2 callersFunctionget_sql_query_param
handle an expression from where clauses (or it can be from anywhere) pick up any expression from left and right that goes some_field = ? some_table.so
src/ts_generator/sql_parser/expressions/translate_expr.rs:130
↓ 2 callersFunctionget_var_decl_name_from_key
(key: &Key)
src/parser/js_parser.rs:31
↓ 2 callersFunctionis_json_build_function
(func_name: &str)
src/ts_generator/sql_parser/expressions/functions.rs:192
↓ 2 callersMethodprepare
( &self, sql: &SQL, should_generate_types: &bool, handler: &Handler, )
src/core/connection.rs:29
↓ 2 callersFunctionprocess_class_member
(sqls: &mut Vec<SQL>, body_stmt: &ClassMember, import_alias: &String)
src/parser/decl.rs:9
↓ 2 callersFunctionprocess_decl
(sqls: &mut Vec<SQL>, decl: &Decl, import_alias: &String)
src/parser/decl.rs:107
↓ 2 callersFunctionprocess_json_build_object_args
Process key-value pairs from JSON build object arguments
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs:94
↓ 2 callersFunctionsuccess
(msg)
node/postinstall.js:21
↓ 2 callersFunctiontranslate_select
( ts_query: &mut TsQuery, table_with_joins: &Option<Vec<TableWithJoins>>, select: &Select, db_conn: &D
src/ts_generator/sql_parser/translate_query.rs:19
↓ 2 callersFunctiontranslate_wildcard_expr
Translates a wildcard expression of a SQL statement @example SELECT * FROM items and it appends result into the hashmap for type generation
src/ts_generator/sql_parser/expressions/translate_wildcard_expr.rs:62
↓ 1 callersFunctioncalculateSHA256
(filePath)
node/postinstall.js:106
↓ 1 callersFunctionclear_single_ts_file_if_exists
clears the target single TS file if it exists
src/ts_generator/generator.rs:101
↓ 1 callersMethodconvert
(&self, value: &str)
src/common/types.rs:37
↓ 1 callersFunctiondefault_connection_timeout
()
src/common/config.rs:67
↓ 1 callersFunctiondefault_pool_size
()
src/common/config.rs:63
↓ 1 callersFunctiondemo
()
demo/sequelize/index.ts:15
↓ 1 callersMethoderror
(message: &str)
src/common/config.rs:439
↓ 1 callersFunctionexecute
(queries: &HashMap<PathBuf, Vec<SQL>>, handler: &Handler)
src/core/execute.rs:11
↓ 1 callersFunctionextractBinary
(zipPath, binaryName, targetPath)
node/postinstall.js:132
↓ 1 callersFunctionextract_annotations_from_sql
Extract annotations from SQL content and return cleaned query Supports @name and @db annotations
src/parser/sql_parser.rs:172
↓ 1 callersFunctionextract_key_name
Extract key name from a function argument (should be a string literal)
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs:12
↓ 1 callersFunctionextract_param_annotations
(query: &str)
src/ts_generator/annotations.rs:30
↓ 1 callersFunctionextract_result_annotations
(query: &str)
src/ts_generator/annotations.rs:5
↓ 1 callersFunctionextract_sql_queries_from_file
Extract SQL queries from raw SQL file content Supports multiple queries separated by semicolons and annotations
src/parser/sql_parser.rs:30
↓ 1 callersMethodfmt_params
The method is to format SQL params extracted via translate methods It can work for SELECT, INSERT, DELETE and UPDATE queries
src/ts_generator/types/ts_query.rs:553
↓ 1 callersMethodfmt_result
(&self, _f: &mut fmt::Formatter<'_>)
src/ts_generator/types/ts_query.rs:584
↓ 1 callersMethodformat_column_name
(&self, column_name: &str)
src/ts_generator/types/ts_query.rs:402
↓ 1 callersFunctionformat_ts_field_name
Format a field name for TypeScript object literal, quoting if necessary
src/ts_generator/types/ts_query.rs:98
↓ 1 callersFunctiongenerate_default_query_name
Generate a default query name from file path and index
src/parser/sql_parser.rs:232
↓ 1 callersFunctiongetBinaryInfo
()
node/postinstall.js:25
↓ 1 callersFunctiongetResource
()
tests/demo/typescript/statement/using.ts:3
↓ 1 callersFunctionget_all_table_names_from_select
(select: &Select)
src/ts_generator/sql_parser/expressions/translate_wildcard_expr.rs:11
↓ 1 callersMethodget_connection
(&mut self, raw_sql: &str)
src/core/connection.rs:63
↓ 1 callersMethodget_correct_db_connection
By passing in a SQL query, for example e.g. -- @db: postgres SELECT * FROM some_table; The method figures out the connection name to connect in order
src/common/config.rs:354
↓ 1 callersMethodget_db_type
Get the database type for this connection
src/core/connection.rs:45
↓ 1 callersMethodget_mysql_cred_str
This is to follow the spec of connection string for MySQL https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-reference-jdbc-url-format.html
src/common/config.rs:369
↓ 1 callersMethodget_postgres_cred
(&self, conn: &DbConnectionConfig)
src/common/config.rs:399
↓ 1 callersFunctionget_query_name
(sql: &SQL)
src/ts_generator/generator.rs:26
↓ 1 callersFunctionget_sql_from_var_decl
you would normally pass in any var declarator such as const sql = sql`SELECT * FROM xxx;`
src/parser/tag.rs:336
↓ 1 callersMethodget_sqlite_path
Returns the file path for a SQLite database connection. If DB_URL is provided, it's used directly. Otherwise DB_NAME is used as the file path.
src/common/config.rs:388
↓ 1 callersFunctionget_var_decl_name
The method grabs the name of the variable if it exists
src/parser/tag.rs:31
↓ 1 callersMethodgte
Check if the current log level is greater than or equal to the other log level
src/common/types.rs:61
↓ 1 callersFunctionhandle_json_agg_function
Handle JSON aggregation functions (jsonb_agg, json_agg, etc.)
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs:160
↓ 1 callersFunctionhandle_json_build_function
Handle JSON build functions (jsonb_build_object, json_build_object, etc.)
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs:129
↓ 1 callersFunctionhandle_polymorphic_functions
( func_obj: &Function, ctx: &mut FunctionHandlersContext<'_>, )
src/ts_generator/sql_parser/expressions/function_handlers/polymorphic_functions.rs:10
↓ 1 callersFunctioninfer_type_from_expr
Infer the TypeScript type from an SQL expression
src/ts_generator/sql_parser/expressions/function_handlers/json_functions.rs:35
↓ 1 callersFunctioninsert_or_append_sqls
(sqls_container: &mut HashMap<PathBuf, Vec<SQL>>, sqls: &[SQL], file_path: &PathBuf)
src/parser/js_parser.rs:21
↓ 1 callersMethodinsert_value_params
This is used to insert value params required for INSERT statements For example if you are given e.g. INSERT INTO table (id, name, address) VALUES (?,
src/ts_generator/types/ts_query.rs:474
↓ 1 callersFunctioninstall
()
node/postinstall.js:149
↓ 1 callersFunctionis_comment_only
Check if a block contains only comments and whitespace
src/parser/sql_parser.rs:152
↓ 1 callersFunctionis_json_agg_function
(func_name: &str)
src/ts_generator/sql_parser/expressions/functions.rs:196
↓ 1 callersFunctionis_match
(pattern: &str, path: &Path)
src/scan_folder.rs:15
↓ 1 callersFunctionis_valid_ts_identifier
Check if a string is a valid TypeScript identifier
src/ts_generator/types/ts_query.rs:14
↓ 1 callersFunctionoptionalParent
()
tests/demo/typescript/expression/chain.ts:16
↓ 1 callersFunctionparent
()
tests/demo/typescript/expression/chain.ts:3
↓ 1 callersFunctionparse_js_file
(path: &PathBuf)
src/parser/js_parser.rs:130
↓ 1 callersFunctionparse_source
(path: &PathBuf)
src/parser/mod.rs:15
↓ 1 callersFunctionparse_sql_file
(path: &PathBuf)
src/parser/sql_parser.rs:13
↓ 1 callersFunctionpattern_to_regex
(pattern: &str)
src/scan_folder.rs:8
↓ 1 callersFunctionprocess_class_decl
(sqls: &mut Vec<SQL>, class: &ClassDecl, import_alias: &String)
src/parser/decl.rs:91
↓ 1 callersFunctionprocess_default_decl
(sqls: &mut Vec<SQL>, default_decl: &DefaultDecl, import_alias: &String)
src/parser/decl.rs:69
↓ 1 callersFunctionscan_folder
(folder: &'a PathBuf, file_extension: &'a FileExtension)
src/scan_folder.rs:33
next →1–100 of 287, ranked by callers