Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.1.0 - WIP #119

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from
Draft

Release/2.1.0 - WIP #119

wants to merge 39 commits into from

Commits on Aug 31, 2021

  1. PR/115 - Recommendations from phpstan. (#118)

    * Fix return types in Query
    * Docs: improvents recommended by phpstan-wordpress.
    
    Props szepeviktor.
    
    Co-authored-by: Viktor Szépe <[email protected]>
    JJJ and szepeviktor authored Aug 31, 2021
    Configuration menu
    Copy the full SHA
    5a4adb2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aeb83f6 View commit details
    Browse the repository at this point in the history
  3. Add composer.lock.

    JJJ committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    d5fd271 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    793ad1c View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2021

  1. Configuration menu
    Copy the full SHA
    674764d View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2021

  1. Query: change the parameter order of private method transition_item()

    This change ensures that, going forward, this methods parameter signature better matches the other _item() methods.
    
    This should be /relatively/ safe to do thanks to it being private. I've looked at all of the projects I'm aware of that use Berlin, and they are all uneffected.
    JJJ committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    5a1375d View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2022

  1. Configuration menu
    Copy the full SHA
    15f8a3a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ec5452a View commit details
    Browse the repository at this point in the history
  3. Update composer deps.

    JJJ committed Apr 29, 2022
    Configuration menu
    Copy the full SHA
    3be9949 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2022

  1. Table: add support for table comment.

    This refactors the Table::create() SQL generator to explode an array of parts, which should make it easier to make more edits to later.
    JJJ committed May 26, 2022
    Configuration menu
    Copy the full SHA
    5670fb5 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2022

  1. WIP - Issue/137 (#140)

    * Column: improvements to $pattern
    * Always a string (no false)
    * Add link to PHP docs
    * Update description to remove "string replace"
    * Set UUID to %s
    * Base: prevent double prefixing in apply_prefix()
    * Column: correct inline doc
    * Column: rename private references from pattern to format.
    * Autoloader: minor code cleanup
    * Column: various improvements:
    * Tons of inline & block docs
    * Smarter default class values
    * Column::args are saved during parse_args() for later reuse
    * Prefer get_object_vars() over another array of args
    * Add "extra" support to special_args()
    * Add is_ methods for some other types
    * Add is_extra() method for comparing extra values
    * Add sanitize_extra() for allowing specific values
    * Improve fallback support in sanitize_pattern()
    * Improve fallback support in sanitize_validation()
    * Remove function_exists check for gmdate() from validate_datetime()
    * Legitimize validate_numeric() and use where appropriate
    * Improve get_create_string() with support for binary, more types, null, etc...
    * Base: introduce sanitize_column_name()
    * Allows upper-case letters in table and column names.
    * Swaps out sanitize_key() usage for a custom preg_replace: '/^[a-zA-Z0-9_\-]+$/'
    * Table: use Base::sanitize_column_name()
    * Also fix return value inline comment in count()
    * Column: introduce validate() and validate_int()
    * validate() centralizes column value validation into the most logical location, and validate_int() allows for falling back to $default in a way that intval obviously could not.
    * Base: update regex.
    * Base: add stash_args() method
    * Also avoid errors in apply_prefix() if not a string.
    * Column: use stash_args()
    * Also bail early if no arguments to parse.
    * Schema: add support for indexes.
    * Move filters into methods and their own section
    * Improve docs, and add missing docs
    * Default values for item_names to prevent fatals
    * Add setup() method and move set_ methods out of __construct() and into it
    * Minimize touches to this->columns for future Schema/Structure work
    * Remove assumptions that primary column must be an int that uses absint/intval - see #124
    * Add some todo's for MySQL 8 improvements
    * Improve support for CURRENT_TIMESTAMP in relevant columns
    * Add get_columns_field_by() to retrieve a single field from a matching array of values to a single key - primarily used for getting an array of column patterns when querying, to return an array of formats for sprintf()
    * Improve readability of do_action_ref_array() calls
    * Clean-up get_item_ids()
    * Rename parse_where() to parse_query_vars()
    * Add parse_where() and parse_join() – likely get renamed in the future
    * Use wp_parse_list() instead of wp_parse_id_list() - likely needs its own handler
    * Prevent fatals from return values of get_search_sql()
    * Abstract repeated code into new get_in_sql() method to escape/prepare/format IN (%s) SQL
    * Introduce parse_query_var() and use it in place of repeated query_vars[] touches - attempts to internally parse comma separated strings (might remove)
    * Introduce undocumented $column->by check to allow a column to not be queried directly by its name
    * Refactor parse_query_vars() to improve its internal patterns, for future abstraction
    * Fallback in parse_fields() and parse_groupby() to prevent fatal errors
    * Introduce parse_single_orderby, parse_limits, parse_join, and parse_where - refactor parse_orderby
    * Some minor clean-up to shape_items()
    * Bail early in get_item_fields() to avoid trying to filter empty fields
    * Introduce validate_item_field() to call $column->validate(), and use it inside shape_item_id() and more. This centralizes validation and ensures they always return the same results.
    * Update add_item() and update_item() to skip database if $save fails validation
    * Update copy_item() to shape the item ID, as it is not done inside of get_item_raw()
    * Update delete_item() to match other item changes above
    * All _item() functions use get_columns_field_by() to get patterns to send into wpdb queries for proper formatting (including delete_all_item_meta) - see #137
    * Update validate_item() to use validate_item_field()
    * Use shape_item_id() in update_item_cache() - also use is_scalar() in place of is_numeric() when making assumptions about the shape of the primary column
    * Stop shaping the ID inside of get_non_cached_ids(), as item IDs are (or should be) previously shaped
    * Gut get_results() and make it use the query() method - this needs more work
    * Query: Introduce filter_search_columns()
    * Switch it to using apply_filters_ref_array() - minor back-compat break
    * Add direct Schema support
    * Get columns directly from Schema
    * Deprecate $columns var
    * Introduce set_query_clause_defaults() for allowing the query & request clauses to be updated easier
    * Add keys to query & request clauses
    * Refactor the way that counts & searches are parsed
    * Always include columns when count & groupby are used together
    * Pass query_vars into more parse_ methods to further abstract their usages for future un-privating
    * Override query_vars in parse_query() when counting
    * Introduce parse_count()
    * Rename parse_where/join to _clauses() suffix
    * Pass arguments into default_item(), and use array_combine()
    * Swap some var orders in prime_item_caches()
    * All: update @copyright and README
    JJJ authored Jun 27, 2022
    Configuration menu
    Copy the full SHA
    9bd5c4e View commit details
    Browse the repository at this point in the history
  2. More readme edits

    JJJ committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    7c515b0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    811e399 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2022

  1. Configuration menu
    Copy the full SHA
    678cae9 View commit details
    Browse the repository at this point in the history
  2. Query: MySQL 8 support

    * Remove $columns
    * Improve query parsing to allow reuse for second COUNT(*) query_clause overrides
    * Add support for SELECT & EXPLAIN clauses
    * Add several new methods to abstract out newly repeated behaviors
    * Add is_valid_column() and get_query_var() and get_column_name_alias() to help with repeated code patterns
    * Add parse_query_vars() again, to help abstract only the parsing part
    * Use get_meta_type() when updating meta data
    * Update prime_item_caches() to not bail early so it can continue on and try updating meta data
    JJJ committed Jun 28, 2022
    Configuration menu
    Copy the full SHA
    de87164 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5a0675a View commit details
    Browse the repository at this point in the history
  4. WIP - Issue/128 (#143)

    * Base: minor refactor to magic methods, and is_success()
    * Query: MySQL 8 support
    * Remove $columns
    * Improve query parsing to allow reuse for second COUNT(*) query_clause overrides
    * Add support for SELECT & EXPLAIN clauses
    * Add several new methods to abstract out newly repeated behaviors
    * Add is_valid_column() and get_query_var() and get_column_name_alias() to help with repeated code patterns
    * Add parse_query_vars() again, to help abstract only the parsing part
    * Use get_meta_type() when updating meta data
    * Update prime_item_caches() to not bail early so it can continue on and try updating meta data
    JJJ authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    72a2266 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2022

  1. Resolve PHPStan Level 0 errors (#144)

    * Resolve PHPStan Level 0 errors
    * Fix boolean handling
    * Revert change for get_sql
    * Make $index public
    szepeviktor authored Jun 29, 2022
    Configuration menu
    Copy the full SHA
    70b0c92 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    66796c4 View commit details
    Browse the repository at this point in the history
  3. Query: bail early with obvious results (not $retval)

    This ends up being easier to understand than following the code backwards.
    JJJ committed Jun 29, 2022
    Configuration menu
    Copy the full SHA
    5b16eed View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2022

  1. Configuration menu
    Copy the full SHA
    a5efe05 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa64a8e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fe344b7 View commit details
    Browse the repository at this point in the history
  4. Schema/Query: mark linked classes as protected.

    Also use __NAMESPACE__
    JJJ committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    c6b4d1d View commit details
    Browse the repository at this point in the history
  5. Column: missed a spot

    JJJ committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    85ea827 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    77310ed View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e54dfc9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5f924b0 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2022

  1. Issue/55 - Query: Add support for query handlers. (#123)

    * Query: Add support for query handlers.
    * Break apart parse_where() into multiple methods
    * These new methods return an array of where & join clauses
    * Those clauses get merged together to maintain backwards compatibility
    * Query: normalize Join/Where order.
    * Query: graduate "join" to first-class clause.
    * Schema: these need to stay protected
    * Query: remove array_flip from get_column_names
    * Query: docs
    * All: improve code consistency
    * Bail early with specific (non retval) values
    * Improve inline docs
    * Remove some unuseful references
    JJJ authored Jul 2, 2022
    Configuration menu
    Copy the full SHA
    4ee4f51 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    563848d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    db020bf View commit details
    Browse the repository at this point in the history
  4. Table: rename some vars

    JJJ committed Jul 2, 2022
    Configuration menu
    Copy the full SHA
    3054f26 View commit details
    Browse the repository at this point in the history
  5. Query: rename query_handlers to query_var_parsers

    Includes some subsequent renames to keep things tidy
    JJJ committed Jul 2, 2022
    Configuration menu
    Copy the full SHA
    195785b View commit details
    Browse the repository at this point in the history
  6. Queries: limit calls to get_db()

    JJJ committed Jul 2, 2022
    Configuration menu
    Copy the full SHA
    824b046 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2022

  1. Configuration menu
    Copy the full SHA
    9757dbe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    838dc9a View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2022

  1. Update src/Database/Query.php

    Co-authored-by: Viktor Szépe <[email protected]>
    JJJ and szepeviktor authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    98a5eb9 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2022

  1. Fix boolean handling in Table (#151)

    `$global` is already a boolean
    szepeviktor authored Jul 13, 2022
    Configuration menu
    Copy the full SHA
    4853bde View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2023

  1. Configuration menu
    Copy the full SHA
    c6e06ae View commit details
    Browse the repository at this point in the history