Giter VIP home page Giter VIP logo

fivem-postgres-async's Introduction

fivem-postgres-async

Allows the use of a postgres database on the fivem-server software.

Usage

  1. Download the master of this repository. (Releases might follow later).
  2. Extract in resources, make sure the folder name is 'pg-async'
  3. Add the following to the server.cfg: ensure pg-async
  4. Add the following to the fxmanifest.lua of your own code
    • dependencies { ..other-deps.., 'pg-async')
    • server_scripts { '@pg-async/pg.lua', ..your_scripts.. }
  5. Usage
    • PgSql.Sync
      • For synchronous methods
      • query(query_string [, params table])
      • transaction(queries_tables)
        • query: the query to execute
        • (optional) parameters: the parameters to add to the query
        • (optional) callback method (err: string, result: table), See Dependencies for more info
    • PgSql.Async
    • For asynchronous methods
    • query(query_string, callback(error, result) [, params table])
    • transaction(queries_tables, callback(error, result))
      • query: the query to execute
      • (optional) parameters: the parameters to add to the query
      • (optional) callback method (err: string, result: table), See Dependencies for more info
    • PgSql.ready(callback), will be called when everything is ready
    • PgSql.format (wrapper for pg-format)
    • Alternative: check pg.lua if you want to call the js code directly.

Dependencies

fivem-postgres-async's People

Contributors

snakesvx avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.