GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - imantung/sqlstr: String manipulation/helper for SQL Query

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
clean.go
clean.go
 
 
clean_test.go
clean_test.go
 
 
obscure.go
obscure.go
 
 
obscure_test.go
obscure_test.go
 
 
query_string.go
query_string.go
 
 
query_string_test.go
query_string_test.go
 
 

Repository files navigation

SQLSTR

String manipulation/helper for SQL Query.

Examples

Clean Query from double white space, comment, etc.

cleaned := sqlstr.Clean(`
  SELECT *
  FROM table -- some table comment 
  WHERE column1 = 'meh' /* request from tyrion*/`)

fmt.Println(cleaned) 

// Output: 
// SELECT * FROM table WHERE column1 = 'meh'

Obscure value

obsecured := sqlstr.Obscure(`SELECT * FROM table WHERE column1 = 'text' AND column2 = 1234 AND column3 = TRUE and column4 = 3.14`)

fmt.Println(obsecured)

// Output: 
// SELECT * FROM table WHERE column1 = ? AND column2 = ? AND column3 = ? and column4 = ?

Get Table Names

queryString := sqlstr.NewQueryString(`SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;`)

tableNames := queryString.TableNames()

fmt.Println(tableNames)

// Output:
// [table1 table2]

Author

[email protected]

About

String manipulation/helper for SQL Query

Topics

sql-cleanersql-obsecurersql-parsersql-tablesqlquerystring-manipulation

Resources

Readme
MIT license
Activity

Stars

8 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.