{"repo":"houqp/sqlvet","free":true,"listed":false,"github":"https://github.com/houqp/sqlvet","clone":"git clone https://github.com/houqp/sqlvet.git","description":"Go fearless SQL. Sqlvet performs static analysis on raw SQL queries in your Go code base.","language":"Go","stars":500,"topics":["golang","sql","static-analysis","linter","security"],"license":"MIT","category":"dev-tools","readme_excerpt":"Sqlvet Sqlvet performs static analysis on raw SQL queries in your Go code base to surface potential runtime errors at build time. Feature highlights: Check for SQL syntax error Identify unsafe queries that could potentially lead to SQL injections For INSERT statements, make sure column count matches value count Validate table names Validate column names TODO: Validate query function argument count and types Support MySQL syntax Type check value list in UPDATE query Trace wrapper function call Usage Installation Go less than 1.18: Go greater or equal 1.18: Zero conf SqlVet should work out of the box for any Go project using go modules: Note: unreachable code will be skipped. Schema validation To enable more in-depth analysis, create a sqlvet.toml config file at the root of your project and specify the path to a database schema file: Customer query functions and libraries By default, sqlvet checks all calls to query function in database/sql , github.com/jmoiron/sqlx , github.com/jinzhu/gorm and go-gorp/gorp libraries. You can however configure it to white-list arbitrary query functions like below: The above config tells sqlvet to analyze any function/method from github.com/mattermost/gorp package that has the first parameter named either query or sql . You can also match query functions by names: The above config tells sqlvet to analyze the second parameter of any function/method named NamedExecContext in github.com/jmoiron/sqlx package. Ignore false positives To skip a false p","default_branch":null,"files":null,"tree":[],"storefront":"/r/houqp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/houqp/sqlvet/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}