docs: add dataset ORM tutorial page and update navigation with GFM documentation
Add new Dataset ORM tutorial page covering CRUD operations, query operators, schema evolution, and JSON field handling. Update navigation.yaml to include the new tutorial in the tutorials section. Enhance markdown module documentation with GitHub Flavored Markdown support details including tables, task lists, and language identifier attributes for syntax highlighting. Update tutorial index page and pagination links to reflect the new tutorial order. Refactor dataset.wren module source to introduce Sql and QueryBuilder classes with soft-delete support and identifier validation.
This commit is contained in:
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "regex" for Regex, Match
|
||||
|
||||
var re = Regex.new("test")
|
||||
System.print(re.test("")) // expect: false
|
||||
|
||||
var re2 = Regex.new("")
|
||||
System.print(re2.test("anything")) // expect: true
|
||||
System.print(re2.test("")) // expect: true
|
||||
|
||||
var re3 = Regex.new("a*")
|
||||
var m = re3.match("")
|
||||
System.print(m.text) // expect:
|
||||
System.print(m.start) // expect: 0
|
||||
System.print(m.end) // expect: 0
|
||||
|
||||
var longStr = "a" * 1000
|
||||
var re4 = Regex.new("a+")
|
||||
System.print(re4.test(longStr)) // expect: true
|
||||
|
||||
var m2 = re4.match(longStr)
|
||||
System.print(m2.text.count) // expect: 1000
|
||||
System.print(m2.start) // expect: 0
|
||||
System.print(m2.end) // expect: 1000
|
||||
|
||||
var re5 = Regex.new("test")
|
||||
var longWithMatch = "x" * 500 + "test" + "y" * 500
|
||||
System.print(re5.test(longWithMatch)) // expect: true
|
||||
var m3 = re5.match(longWithMatch)
|
||||
System.print(m3.start) // expect: 500
|
||||
System.print(m3.end) // expect: 504
|
||||
|
||||
System.print(Regex.test("^$", "")) // expect: true
|
||||
System.print(Regex.test("^$", "x")) // expect: false
|
||||
System.print(Regex.test("^", "anything")) // expect: true
|
||||
System.print(Regex.test("$", "anything")) // expect: true
|
||||
|
||||
var re6 = Regex.new("(a)(b)(c)(d)(e)(f)(g)(h)")
|
||||
var m4 = re6.match("abcdefgh")
|
||||
System.print(m4.groups.count) // expect: 9
|
||||
System.print(m4[0]) // expect: abcdefgh
|
||||
System.print(m4[1]) // expect: a
|
||||
System.print(m4[8]) // expect: h
|
||||
|
||||
var re7 = Regex.new("((a)(b))((c)(d))")
|
||||
var m5 = re7.match("abcd")
|
||||
System.print(m5[0]) // expect: abcd
|
||||
System.print(m5[1]) // expect: ab
|
||||
System.print(m5[2]) // expect: a
|
||||
System.print(m5[3]) // expect: b
|
||||
System.print(m5[4]) // expect: cd
|
||||
System.print(m5[5]) // expect: c
|
||||
System.print(m5[6]) // expect: d
|
||||
|
||||
var re8 = Regex.new("test")
|
||||
System.print(re8.test("test")) // expect: true
|
||||
System.print(re8.test("testing")) // expect: true
|
||||
System.print(re8.test("a test")) // expect: true
|
||||
System.print(re8.test("TEST")) // expect: false
|
||||
|
||||
var re9 = Regex.new("x")
|
||||
var allMatch = re9.matchAll("xxx")
|
||||
System.print(allMatch.count) // expect: 1
|
||||
System.print(allMatch[0].start) // expect: 0
|
||||
|
||||
System.print(Regex.test("[0-9]", "5")) // expect: true
|
||||
System.print(Regex.test("[a-zA-Z0-9_]+", "hello_123")) // expect: true
|
||||
|
||||
var parts = Regex.split(",", "a,b,c,d,e")
|
||||
System.print(parts.count) // expect: 5
|
||||
System.print(parts[4]) // expect: e
|
||||
Reference in New Issue
Block a user