1
0
Fork 0

Build UnicodeData using all data inside unicode_data table

This commit is contained in:
Daniele Tricoli 2015-12-11 03:19:06 +01:00
parent a1dd484d44
commit 8774132261
1 changed files with 17 additions and 2 deletions

View File

@ -51,7 +51,7 @@ const (
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
createLastUpdateQuery = `INSERT INTO last_update (filename, date) VALUES (?, ?)` createLastUpdateQuery = `INSERT INTO last_update (filename, date) VALUES (?, ?)`
getLastUpdateQuery = `SELECT date FROM last_update WHERE filename = ?` getLastUpdateQuery = `SELECT date FROM last_update WHERE filename = ?`
getUnicodeQuery = `SELECT codepoint, name, category FROM unicode_data WHERE name MATCH ?` getUnicodeQuery = `SELECT * FROM unicode_data WHERE name MATCH ?`
countUnicodeQuery = `SELECT count(*) FROM unicode_data` countUnicodeQuery = `SELECT count(*) FROM unicode_data`
) )
@ -183,7 +183,22 @@ func (s *Store) SearchUnicode(name string) (records []UnicodeData, err error) {
for rows.Next() { for rows.Next() {
var row UnicodeData var row UnicodeData
if err := rows.Scan(&row.CodePoint, &row.Name, &row.Category); err != nil { if err := rows.Scan(
&row.CodePoint,
&row.Name,
&row.Category,
&row.CanonicalClass,
&row.BidiClass,
&row.DecompositionType,
&row.NumericType,
&row.NumericDigit,
&row.NumericValue,
&row.BidiMirrored,
&row.Unicode1Name,
&row.ISOComment,
&row.SimpleUppercaseMapping,
&row.SimpleLowercaseMapping,
&row.SimpleTitlecaseMapping); err != nil {
return []UnicodeData{}, err return []UnicodeData{}, err
} }