mirror of
				https://github.com/nalgeon/redka.git
				synced 2025-10-31 11:26:54 +08:00 
			
		
		
		
	 818954d339
			
		
	
	818954d339
	
	
	
		
			
			Shared cache is discouraged. The supported alternative (and increasingly recommended by SQLite developers), is the memdb VFS (which I believe is supported by all drivers). I'm sure modernc has it, and mattn also does if compiled with SQLITE_ENABLE_DESERIALIZE, which became the default in 2021. https://github.com/ncruces/go-sqlite3/issues/94#issuecomment-2157679766
		
			
				
	
	
		
			27 lines
		
	
	
		
			487 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			487 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package set
 | |
| 
 | |
| import (
 | |
| 	"slices"
 | |
| 	"sort"
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/nalgeon/redka"
 | |
| 	"github.com/nalgeon/redka/internal/core"
 | |
| 	"github.com/nalgeon/redka/internal/redis"
 | |
| )
 | |
| 
 | |
| func getDB(tb testing.TB) (*redka.DB, redis.Redka) {
 | |
| 	tb.Helper()
 | |
| 	db, err := redka.Open("file:/data.db?vfs=memdb", nil)
 | |
| 	if err != nil {
 | |
| 		tb.Fatal(err)
 | |
| 	}
 | |
| 	return db, redis.RedkaDB(db)
 | |
| }
 | |
| 
 | |
| func sortValues(vals []core.Value) {
 | |
| 	sort.Slice(vals, func(i, j int) bool {
 | |
| 		return slices.Compare(vals[i], vals[j]) < 0
 | |
| 	})
 | |
| }
 |