{"data":[{"name":"select","description":"Retrieve data from a table.","signature":["select($table, $columns)","select($table, $columns, $where)","select($table, $join, $columns, $where)"],"parameters":[{"table [string]":"The name of the table to query.","columns [array/string]":"The column or columns to retrieve."},{"table [string]":"The name of the table to query.","columns [array/string]":"The column or columns to retrieve.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables. Omit this parameter if no joins are required.","columns [array/string]":"The column or columns to retrieve.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[array] An array containing the retrieved rows.","note":"You can use <code>*</code> for the columns parameter to retrieve all columns. However, explicitly specifying only the required columns is recommended for better performance and readability.","desc":"Retrieve data from a table.","url":"/api/select","key":"select","documentation_url":"https://medoo.in/api/select"},{"name":"insert","description":"Insert one or more records into a table.","signature":"insert($table, $values)","parameters":{"table [string]":"The name of the table.","values [array]":"The data to be inserted."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","desc":"Insert one or more records into a table.","url":"/api/insert","key":"insert","documentation_url":"https://medoo.in/api/insert"},{"name":"update","description":"Update records in a table.","signature":"update($table, $data, $where)","parameters":{"table [string]":"The name of the table.","data [array]":"The column-value pairs to update.","where [array] (optional)":"The WHERE clause used to filter the records to be updated."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","note":"Like <code>insert()</code>, this method supports array serialization and automatic type detection. It also supports <code>[+]</code>, <code>[-]</code>, <code>[*]</code>, and <code>[/]</code> operators for arithmetic updates.","desc":"Update records in a table.","url":"/api/update","key":"update","documentation_url":"https://medoo.in/api/update"},{"name":"delete","description":"Delete records from a table.","signature":"delete($table, $where)","parameters":{"table [string]":"The name of the table.","where [array]":"The WHERE clause used to filter the records to be deleted."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","desc":"Delete records from a table.","url":"/api/delete","key":"delete","documentation_url":"https://medoo.in/api/delete"},{"name":"replace","description":"Replace records in a table. Existing records with a matching primary key are deleted and reinserted; otherwise, a new record is inserted.","signature":"replace($table, $columns, $where)","parameters":{"table [string]":"The name of the table.","columns [array]":"The column-value pairs that define the replacement mapping.","where [array] (optional)":"The WHERE clause used to filter the target records."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","desc":"Replace records in a table. Existing records with a matching primary key are deleted and reinserted; otherwise, a new record is inserted.","url":"/api/replace","key":"replace","documentation_url":"https://medoo.in/api/replace"},{"name":"create","description":"Create a new table.","signature":"create($table, $columns, $options)","parameters":{"table [string]":"The name of the table to create.","columns [array]":"The column definitions for the new table.","options [array/string] (optional)":"Additional options to apply when creating the table."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","desc":"Create a new table.","url":"/api/create","key":"create","documentation_url":"https://medoo.in/api/create"},{"name":"drop","description":"Drop an existing table.","signature":"drop($table)","parameters":{"table [string]":"The name of the table to drop."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","desc":"Drop an existing table.","url":"/api/drop","key":"drop","documentation_url":"https://medoo.in/api/drop"},{"name":"get","description":"Retrieve a single record from a table.","signature":["get($table, $columns, $where)","get($table, $join, $columns, $where)"],"parameters":[{"table [string]":"The name of the table to query.","columns [string/array]":"The column or columns to retrieve.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables. Omit this parameter if no joins are required.","columns [string/array]":"The column or columns to retrieve.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[mixed] The first matching record as a scalar value or associative array.","desc":"Retrieve a single record from a table.","url":"/api/get","key":"get","documentation_url":"https://medoo.in/api/get"},{"name":"has","description":"Check whether any matching record exists in a table.","signature":["has($table, $where)","has($table, $join, $where)"],"parameters":[{"table [string]":"The name of the table to query.","where [array]":"The WHERE clause used to check for matching records."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables.","where [array]":"The WHERE clause used to check for matching records."}],"returns":"[bool] <code>true</code> if at least one matching record exists, <code>false</code> otherwise.","desc":"Check whether any matching record exists in a table.","url":"/api/has","key":"has","documentation_url":"https://medoo.in/api/has"},{"name":"count","description":"Count matching rows in a table.","signature":["count($table, $where)","count($table, $join, $column, $where)"],"parameters":[{"table [string]":"The name of the table to query.","where [array] (optional)":"The WHERE clause used to filter the rows to count."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables.","column [string]":"The column to count.","where [array] (optional)":"The WHERE clause used to filter the rows to count."}],"returns":"[int] The number of matching rows.","note":"This method always returns an integer.","desc":"Count matching rows in a table.","url":"/api/count","key":"count","documentation_url":"https://medoo.in/api/count"},{"name":"max","description":"Return the maximum value of a column.","signature":["max($table, $column, $where)","max($table, $join, $column, $where)"],"parameters":[{"table [string]":"The name of the table to query.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[mixed] The maximum value found in the specified column.","desc":"Return the maximum value of a column.","url":"/api/max","key":"max","documentation_url":"https://medoo.in/api/max"},{"name":"min","description":"Return the minimum value of a column.","signature":["min($table, $column, $where)","min($table, $join, $column, $where)"],"parameters":[{"table [string]":"The name of the table to query.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[mixed] The minimum value found in the specified column.","desc":"Return the minimum value of a column.","url":"/api/min","key":"min","documentation_url":"https://medoo.in/api/min"},{"name":"avg","description":"Calculate the average value of a column.","signature":["avg($table, $column, $where)","avg($table, $join, $column, $where)"],"parameters":[{"table [string]":"The name of the table to query.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[mixed] The average value of the specified column.","desc":"Calculate the average value of a column.","url":"/api/avg","key":"avg","documentation_url":"https://medoo.in/api/avg"},{"name":"sum","description":"Calculate the sum of values in a column.","signature":["sum($table, $column, $where)","sum($table, $join, $column, $where)"],"parameters":[{"table [string]":"The name of the table to query.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables.","column [string]":"The column to evaluate.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[mixed] The sum of the values in the specified column.","desc":"Calculate the sum of values in a column.","url":"/api/sum","key":"sum","documentation_url":"https://medoo.in/api/sum"},{"name":"rand","description":"Retrieve a random set of records from a table.","signature":["rand($table, $columns, $where)","rand($table, $join, $columns, $where)"],"parameters":[{"table [string]":"The name of the table to query.","columns [string/array]":"The column or columns to retrieve.","where [array] (optional)":"The WHERE clause used to filter the result set."},{"table [string]":"The name of the table to query.","join [array]":"The join definitions used to combine related tables. Omit this parameter if no joins are required.","columns [string/array]":"The column or columns to retrieve.","where [array] (optional)":"The WHERE clause used to filter the result set."}],"returns":"[array] A randomly ordered result set from the table.","desc":"Retrieve a random set of records from a table.","url":"/api/rand","key":"rand","documentation_url":"https://medoo.in/api/rand"},{"name":"id","description":"Return the ID of the last inserted row.","signature":"id($name)","parameters":{"name [string] (optional)":"The name of the sequence object. When provided, this returns the last value generated for that sequence."},"returns":"[string|null] The last insert ID as a string, or null when no ID is available.","desc":"Return the ID of the last inserted row.","url":"/api/id","key":"id","documentation_url":"https://medoo.in/api/id"},{"name":"query","description":"Execute a custom raw SQL query.","signature":"query($query, $map)","parameters":{"query [string]":"The SQL query to execute.","map [array] (optional)":"The input parameter values for the prepared statement."},"returns":"[PDOStatement] The PDOStatement instance for the executed query.","note":"Medoo generates queries using SQL-92 syntax. When writing raw SQL, ensure values are quoted correctly, and prefer prepared statements whenever possible to reduce the risk of SQL injection.","desc":"Execute a custom raw SQL query.","url":"/api/query","key":"query","documentation_url":"https://medoo.in/api/query"},{"name":"raw","description":"Medoo provides raw expressions for complex and highly customizable queries. Raw expressions also support placeholders to prevent SQL injection, plus shortcut syntax for identifier quoting.","signature":"Medoo::raw($query, $map)","parameters":{"query [string]":"The raw SQL expression.","map [array] (optional)":"Input parameter values for prepared statements."},"desc":"Medoo provides raw expressions for complex and highly customizable queries. Raw expressions also support placeholders to prevent SQL injection, plus shortcut syntax for identifier quoting.","url":"/api/raw","key":"raw","documentation_url":"https://medoo.in/api/raw"},{"name":"quote","description":"Quote a string for use in a query.","signature":"quote($string)","parameters":{"string [string]":"The string to quote."},"returns":"[string] The quoted string.","desc":"Quote a string for use in a query.","url":"/api/quote","key":"quote","documentation_url":"https://medoo.in/api/quote"},{"name":"action","description":"Run queries inside a transaction.","signature":"action($callback)","parameters":{"callback [callable]":"The callback containing the queries to execute within the transaction."},"returns":"void","note":"Transaction support depends on the database engine. If the callback returns <code>false</code>, the transaction is rolled back; otherwise, it is committed automatically.","desc":"Run queries inside a transaction.","url":"/api/action","key":"action","documentation_url":"https://medoo.in/api/action"},{"name":"debug","description":"Enable debug mode to print the generated SQL without executing it.","signature":"debug()","returns":"[Medoo] The Medoo instance with debug mode enabled.","note":"Medoo outputs the generated SQL without executing it. Disable debug mode after troubleshooting.","desc":"Enable debug mode to print the generated SQL without executing it.","url":"/api/debug","key":"debug","documentation_url":"https://medoo.in/api/debug"},{"name":"log","description":"Return the executed query log.","signature":"log()","returns":"[array] An array containing the recorded SQL queries and execution times.","note":"If <code>logging => true</code> is enabled during initialization, all recorded queries are returned. Otherwise, only the most recent query is returned.","desc":"Return the executed query log.","url":"/api/log","key":"log","documentation_url":"https://medoo.in/api/log"},{"name":"last","description":"Return the last executed query.","signature":"last()","returns":"[string] The last executed SQL query string.","note":"Similar to <code>log()</code>, but always returns only the most recent query.","desc":"Return the last executed query.","url":"/api/last","key":"last","documentation_url":"https://medoo.in/api/last"},{"name":"info","description":"Return information about the current database connection.","signature":"info()","returns":"[array] An array containing information about the database connection.","desc":"Return information about the current database connection.","url":"/api/info","key":"info","documentation_url":"https://medoo.in/api/info"}],"meta":{"count":24}}
