{"repo":"poggit/libasynql","free":true,"listed":false,"github":"https://github.com/poggit/libasynql","clone":"git clone https://github.com/poggit/libasynql.git","description":"Asynchronous MySQL access library for PocketMine plugins.","language":"PHP","stars":144,"topics":["poggit","pocketmine-plugins","mysql-access","mysqli","php","asynctask","virion","sqlite3","async-pool","poggit-virion"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"libasynql Asynchronous SQL access library for PocketMine plugins. Why should I use this library and what does asynchronous mean? When executing a SQL query on the main thread, there will be a delay to wait for the MySQL server or SQLite for interacting with the file system. The delay will block the main thread and cause lag to the server . Libasynql uses different threads for executing the queries so the main thread will not lag! Look in here as well if you want to learn more about threading. Usage The basic use of libasynql has 5 steps: 1. Add default database settings in your config.yml . 2. Write down all the SQL queries you will use in a resource file 3. Initialize the database in onEnable() . 4. Finalize the database in onDisable() . 5. Obviously, and most importantly, use libasynql in your code. Configuration To let the user choose what database to use, copy the following into your default config.yml . Remember to change the default schema name under mysql . Initialization and Finalization libasynql simplifies the process of initializing a database into a single function call. The \\poggit\\libasynql\\libasynql::create() method accepts 3 parameters: - Your plugin main (basically $this if the code runs in onEnable()) - The config entry where the database settings should be found (read the example from above) - An array for your SQL files. For each SQL dialect you are supporting, use it as the key, and use the path (or array of paths, relative to the resources folder) of the","default_branch":null,"files":null,"tree":[],"storefront":"/r/poggit","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/poggit/libasynql/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}