package
0.0.0-20240917120716-8843776e9f3a
Repository: https://github.com/cossacklabs/acra.git
Documentation: pkg.go.dev
# Functions
FilterTableExpressions check if sqlparser.Statement contains TableExprs.
FindColumnInfo get ColumnInfo from TableExprs, ColName and TableSchemaStore.
GetColumnSetting get ColumnEncryptionSetting from schemaStore based on tableName and column.
GetTablesWithAliases collect all tables from all update TableExprs which may be as subquery/table/join/etc collect only table names and ignore aliases for subqueries.
GetWhereStatements parse all Where expressions.
MapColumnsToAliases parse slice of ColumnInfo from sqlparser.Select and config.TableSchemaStore.
NewArrayQueryObservableManager create new ArrayQueryObservableManager.
NewOnQueryObjectFromQuery return OnQueryObject with query string as value.
NewOnQueryObjectFromStatement return OnQueryObject with Statement as value.
NewQueryEncryptor create QueryDataEncryptor with MySQLDBDataCoder.
NewSearchableQueryFilter create new SearchableQueryFilter from schemaStore and SearchableQueryFilterMode.
ParsePlaceholderIndex parse placeholder index if SQLVal is PgPlaceholder/ValArg otherwise return error and InvalidPlaceholderIndex.
ParseQuerySettings parse list of select query settings based on schemaStore.
ParseSearchQueryPlaceholdersSettings parse encryption settings of statement with placeholders.
UpdateExpressionValue decode value from DB related string to binary format, call updateFunc, encode to DB string format and replace value in expression with new.
UpdateUnaryExpressionValue updates supported unary expression By now, supported are only `_binary` charsets, that are parsed as unary expr.
# Constants
InvalidPlaceholderIndex value that represent invalid index for sql placeholders.
# Variables
ErrInconsistentPlaceholder is returned when a placeholder refers to multiple different columns.
ErrUnsupportedQueryType represent error related unsupported Query type.
ErrUpdateLeaveDataUnchanged show that data wasn't changed in UpdateExpressionValue with updateFunc.
# Structs
ArrayQueryObservableManager store all subscribed observes and call sequentially OnQuery on each observer.
DBDataCoder implement DBDataCoder for MySQL.
QueryDataEncryptor parse query and encrypt raw data according to TableSchemaStore.
SearchableExprItem represent the filtered value found by SearchableQueryFilter.
SearchableQueryFilter filter searchable expression based on SearchableQueryFilterMode.
# Interfaces
OnQueryObject interface for result of OnQuery call.
QueryObservable used to handle subscribers for new incoming queries.
QueryObserver observes database queries and is able to modify them.
QueryObserverManager interface for observer aggregations.