gopgext Allows Developers to Build PostgreSQL Extensions Using Go
A new tool named gopgext enables developers to author PostgreSQL extensions using plain Go code and TinyGo, automating the creation of C glue, install scripts, and control files.
🤖AI ModelsPhoto: Hacker News Front Page
Key points
- Build PostgreSQL extensions using plain Go and TinyGo
- Supports standard library features, data types, and custom structures
- Enables triggers, custom index access methods, and foreign data wrappers
A newly introduced project called gopgext is giving developers the ability to write PostgreSQL extensions directly in plain Go by leveraging TinyGo. By simply marking a function with a specific directive, the system automatically handles the generation of C glue, control files, and installation scripts. The project supports standard Go library features including regular expressions, formatting, JSON encoding, cryptography, and generics, bridging standard programming practices with database management.
The software translates common data types such as strings, numbers, arrays, timestamps, and UUIDs directly into SQL equivalents while also allowing custom data types and composite structures to be defined in Go. Furthermore, developers can run SQL commands through SPI, manage logs, return errors with specific SQLSTATE codes, and write complex components like triggers, aggregates, foreign data wrappers, and custom index access methods.
According to the project details, several Go extensions can be loaded simultaneously into a single database backend. Safety measures ensure that PostgreSQL errors do not unwind through Go frames, and data results are securely copied directly into PostgreSQL memory. The architecture shares a similar methodology with gokm, a tool designed for building Linux kernel modules from Go.
Source Hacker News Front Page — jespino.github.io/gopgext/ ↗
Read next
⚖️Regulation & PolicyICE Expands Surveillance Reach Using Flock Safety Camera Network via Local Police Proxies
US Immigration and Customs Enforcement is increasingly utilizing AI-integrated license plate readers from Flock Safety by routing requests through local police department…
🚀Startups & FundingStartups Showcase Body-Integrated Tech with Smart Lenses and Graphene Bandages
Startups Xpanceo and Grapheal presented next-generation wearable technology at Dubai Future Week, featuring smart contact lenses and graphene-based biosensor bandages des…
🔌Chips & HardwareNvidia CEO Jensen Huang Set for Congressional Hearings on China Ties and Chip Sales
Nvidia CEO Jensen Huang faces a series of closed-door and public congressional hearings this week regarding chip sales and ties to China.
🚀Startups & FundingDating App User Banned After Secretly Recording Dates for AI Analysis
A New York hedge fund manager has been banned from Hinge after using a transcription app and Anthropic's Claude to secretly record and analyze his romantic dates.
⚖️Regulation & PolicyRuneScape Developer Jagex Urges Password Resets Following Security Breach
Millions of RuneScape and Old School RuneScape accounts may have been compromised after unauthorized access exposed player emails, hashed passwords, and authenticator tok…
🏢Big TechAnthropic and OpenAI: how the enterprise AI race has shifted
Enterprise spending estimates and recent product decisions show Anthropic and OpenAI moving toward the same business customers.