Skip to content

tkys/highlite_sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

highlite_sqlite

from source

gcc -g -fPIC -shared snippet_ext.c -o snippet_ext.so

load extension file


$ sqlite3

sqlite> SELECT load_extension('./snippet_ext.so');

how to use

sample

$ sqlite3

sqlite> SELECT load_extension('./snippet_ext.so');

sqlite> CREATE  TABLE tbl (text text);

sqlite> INSERT  INTO tbl VALUES ("hogefugahoge");



sqlite> SELECT snippet_ext(text, 'hoge', '<b>', '</b>') FROM tbl ;

<b>hoge</b>fuga<b>hoge</b>



sqlite> SELECT snippet_ext(text, 'g', '<b>', '</b>') FROM tbl ;

ho<b>g</b>efu<b>g</b>aho<b>g</b>e



sqlite> CREATE  TABLE books (id, title, text);
sqlite> INSERT  INTO books VALUES ( 0, "Search system", "Guide book for search devs");

sqlite> SELECT id, snippet_ext(title, 'Search', '<h1>', '</h1>'), snippet_ext(text , 'search', '<b>', '</b>') FROM books ;
0|<h1>Search</h1> system|Guide book for <b>search</b> devs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages