mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 03:02:25 -05:00 
			
		
		
		
	[chore] bump ncruces/go-sqlite3 to v0.25.0 (#3966)
This commit is contained in:
		
					parent
					
						
							
								6473886c8e
							
						
					
				
			
			
				commit
				
					
						db4b857159
					
				
			
		
					 36 changed files with 636 additions and 578 deletions
				
			
		
							
								
								
									
										16
									
								
								vendor/github.com/ncruces/go-sqlite3/config.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/github.com/ncruces/go-sqlite3/config.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -4,6 +4,7 @@ import ( | |||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"strconv" | ||||
| 	"sync/atomic" | ||||
| 
 | ||||
| 	"github.com/tetratelabs/wazero/api" | ||||
| 
 | ||||
|  | @ -48,6 +49,15 @@ func (c *Conn) Config(op DBConfig, arg ...bool) (bool, error) { | |||
| 	return util.ReadBool(c.mod, argsPtr), c.error(rc) | ||||
| } | ||||
| 
 | ||||
| var defaultLogger atomic.Pointer[func(code ExtendedErrorCode, msg string)] | ||||
| 
 | ||||
| // ConfigLog sets up the default error logging callback for new connections. | ||||
| // | ||||
| // https://sqlite.org/errlog.html | ||||
| func ConfigLog(cb func(code ExtendedErrorCode, msg string)) { | ||||
| 	defaultLogger.Store(&cb) | ||||
| } | ||||
| 
 | ||||
| // ConfigLog sets up the error logging callback for the connection. | ||||
| // | ||||
| // https://sqlite.org/errlog.html | ||||
|  | @ -265,6 +275,10 @@ func traceCallback(ctx context.Context, mod api.Module, evt TraceEvent, pDB, pAr | |||
| // | ||||
| // https://sqlite.org/c3ref/wal_checkpoint_v2.html | ||||
| func (c *Conn) WALCheckpoint(schema string, mode CheckpointMode) (nLog, nCkpt int, err error) { | ||||
| 	if c.interrupt.Err() != nil { | ||||
| 		return 0, 0, INTERRUPT | ||||
| 	} | ||||
| 
 | ||||
| 	defer c.arena.mark()() | ||||
| 	nLogPtr := c.arena.new(ptrlen) | ||||
| 	nCkptPtr := c.arena.new(ptrlen) | ||||
|  | @ -378,6 +392,6 @@ func (c *Conn) EnableChecksums(schema string) error { | |||
| 	} | ||||
| 
 | ||||
| 	// Checkpoint the WAL. | ||||
| 	_, _, err = c.WALCheckpoint(schema, CHECKPOINT_RESTART) | ||||
| 	_, _, err = c.WALCheckpoint(schema, CHECKPOINT_FULL) | ||||
| 	return err | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue