mariadb query file: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{Notice|This function is provided by the official MariaDB plugin.}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|mariadb_query_file(handle_...")
 
No edit summary
 
Line 2: Line 2:
{{Notice|This function is provided by the official [[MariaDB]] plugin.}}
{{Notice|This function is provided by the official [[MariaDB]] plugin.}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|This function reads all queries from the specified file and executes them.}}


{{FuncSyntax|mariadb_query_file(handle_id, file_path [, callback_func, callback_args])}}
{{FuncSyntax|mariadb_query_file(handle_id, file_path [, callback_func, callback_args])}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|handle_id|__EDIT_ME__}}
{{FuncParam|handle_id|The mariaDB handle identifier.}}
{{FuncParam|file_path |__EDIT_ME__}}
{{FuncParam|file_path |The file to read the queries from.}}
{{FuncParam|callback_func|__EDIT_ME__}}
{{FuncParamOptional|callback_func|The callback name.}}
{{FuncParamOptional|callback_args|__EDIT_ME__}}
{{FuncParamOptional|callback_args|The callback arguments.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' if '''success'''.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
mariadb_query_file(db, "players.sql")
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:MariaDBFunctions}}

Latest revision as of 14:11, 20 November 2019

mariadb query file

Type: Function
Context: Server
Introduced: v1.0

NOTICE

This function is provided by the official MariaDB plugin.

Description

This function reads all queries from the specified file and executes them.

Syntax

mariadb_query_file(handle_id, file_path [, callback_func, callback_args])

Parameters

  • handle_id
    The mariaDB handle identifier.
  • file_path
    The file to read the queries from.
  • callback_func (optional)
    The callback name.
  • callback_args (optional)
    The callback arguments.

Return Value

  • Returns true if success.

Example

mariadb_query_file(db, "players.sql")

See also