Skip to content

shigenobu/mysql_ws_split

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ws_split - MySQL UDF for split.

about

This is MySQL User Defined Function written by cgo.
Split from string to json array.

arg explain
arg1 pattern regexp pattern string
arg2 subject base string

how to install

$ ./build.sh

(notice)

  • require root privilege

example

(simple)

MariaDB [(none)]> select json_detailed(ws_split(',', 'aa,bb,cc')) as array;
+----------------------------------+
| array                            |
+----------------------------------+
| [
    "aa",
    "bb",
    "cc"
] |
+----------------------------------+

(pattern)

MariaDB [(none)]> select json_detailed(ws_split('[\\s,]+', 'hypertext language, programming')) as array;
+--------------------------------------------------------+
| array                                                  |
+--------------------------------------------------------+
| [
    "hypertext",
    "language",
    "programming"
] |
+--------------------------------------------------------+

About

MySQL UDF for split.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published