Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 3 of 3 for IsInvalidDBNameChar (0.1 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. utils/utils.go

    func FileWithLineNum() string {
    	frame := CallerFrame()
    	if frame.PC != 0 {
    		return string(strconv.AppendInt(append([]byte(frame.File), ':'), int64(frame.Line), 10))
    	}
    
    	return ""
    }
    
    func IsInvalidDBNameChar(c rune) bool {
    	return !unicode.IsLetter(c) && !unicode.IsNumber(c) && c != '.' && c != '*' && c != '_' && c != '$' && c != '@'
    }
    
    // CheckTruth check string true or not
    func CheckTruth(vals ...string) bool {
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Thu Oct 30 10:56:26 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  2. utils/utils_test.go

    	"strings"
    	"testing"
    	"time"
    )
    
    func TestIsInvalidDBNameChar(t *testing.T) {
    	for _, db := range []string{"db", "dbName", "db_name", "db1", "1dbname", "db$name"} {
    		if fields := strings.FieldsFunc(db, IsInvalidDBNameChar); len(fields) != 1 {
    			t.Fatalf("failed to parse db name %v", db)
    		}
    	}
    }
    
    func TestCheckTruth(t *testing.T) {
    	checkTruthTests := []struct {
    		v   string
    		out bool
    	}{
    		{"123", true},
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Fri Sep 19 01:49:06 GMT 2025
    - 4.9K bytes
    - Click Count (0)
  3. chainable_api.go

    func (db *DB) Omit(columns ...string) (tx *DB) {
    	tx = db.getInstance()
    
    	if len(columns) == 1 && strings.ContainsRune(columns[0], ',') {
    		tx.Statement.Omits = strings.FieldsFunc(columns[0], utils.IsInvalidDBNameChar)
    	} else {
    		tx.Statement.Omits = columns
    	}
    	return
    }
    
    // MapColumns modify the column names in the query results to facilitate align to the corresponding structural fields
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Fri Sep 19 01:49:06 GMT 2025
    - 14.8K bytes
    - Click Count (0)
Back to Top