PostgreSQL Library

Description

PostgresConnection (Lua/Minetest) 🔗

A simple Lua wrapper for PostgreSQL using a C library (luapg.so) for Minetest.

Functions 🔗

PostgresConnection.new(host, dbname, user, password) 🔗

Creates a new connection to a PostgreSQL database.

Returns:

  • PostgresConnection object on success
  • nil, error_message on failure

PostgresConnection.new_from_conf(config_path) 🔗

Creates a new connection using a configuration file.

Returns:

  • PostgresConnection object on success
  • nil, error_message if config file is missing or empty

PostgresConnection:execute(query) 🔗

Executes a non-select SQL query (INSERT, UPDATE, DELETE, etc.).

Returns:

  • true on success
  • false, error_message on failure

PostgresConnection:select(query) 🔗

Executes a SELECT query and returns the resulting rows.

Returns:

  • table of rows on success
  • nil, error_message on failure

PostgresConnection:escape(text, escaping_type) 🔗

Escapes a string or identifier for safe usage in SQL queries.

Parameters:

  • text (string) – the value or identifier to escape
  • escaping_type (string) – "value" for SQL values, "identifier" for table/column names (defaults to "value" if invalid)

Returns:

  • Escaped string on success
  • nil, error_message on failure

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

postgresql 1.21

Download

Luanti 5.5+

2025-08-19 22:37 UTC

postgresql 1.21 🔗

No release notes

postgresql 1.2

Download

Luanti 5.5+

2025-08-19 22:26 UTC

postgresql 1.2 🔗

No release notes

1.1

Download

Luanti 5.5+

2025-08-18 04:17 UTC

1.1 🔗

No release notes

postgresql 1.0

Download

Luanti 5.5+

2025-07-26 02:11 UTC

postgresql 1.0 🔗

No release notes

All releases

Information

Provides

postgresql

Dependencies

Required
No required dependencies

Information

Type
Mod
Technical Name
postgresql
Languages
English
License
MIT
Maintenance State
Maintenance Only
Added
2025-07-26 02:04 UTC
Maintainers
Tomlaus