[HN Gopher] SQLite transactions and virtual tables
       ___________________________________________________________________
        
       SQLite transactions and virtual tables
        
       Author : preetamjinka
       Score  : 65 points
       Date   : 2025-04-17 17:28 UTC (5 hours ago)
        
 (HTM) web link (misfra.me)
 (TXT) w3m dump (misfra.me)
        
       | Jupe wrote:
       | Interesting. But this uses mattn's go-sqlite3 package, which is
       | CGO.
       | 
       | Is this a normal/expected requirement in modern GO?
        
         | preetamjinka wrote:
         | We use mattn's go-sqlite3 in our SaaS product. It's not ideal
         | from a toolchain perspective (i.e. cross compiling becomes a
         | little annoying, especially with multi-arch Docker images) but
         | once you get across that hurdle, we haven't run into any major
         | problems with cgo.
        
           | hamburglar wrote:
           | The problem with cgo is it reduces portability, not that it
           | causes issues. If whatever C you're invoking doesn't build on
           | your architecture or if you need to cross-compile (last I
           | checked), you're out of luck.
        
         | ncruces wrote:
         | Virtual tables are fully supported by my CGO free driver:
         | https://pkg.go.dev/github.com/ncruces/go-sqlite3
         | 
         | You can have a look at a bunch of examples in my extensions
         | folder: https://github.com/ncruces/go-sqlite3/tree/main/ext
         | 
         | PS: The mattn CGO driver actually doesn't seem to support
         | wrapping the xBegin/xSync/xRollback/xCommit methods. Mine
         | actually does, although it's largely untested, as I haven't
         | needed this yet.
        
       ___________________________________________________________________
       (page generated 2025-04-17 23:00 UTC)