Pure PHP NoSQL database with no dependency. Flat file, JSON based document database.

Overview

Please give it a Star if you like the project πŸŽ‰ ❀️

SleekDB - A NoSQL Database made using PHP

Full documentation: https://sleekdb.github.io/

SleekDB is a simple flat file NoSQL like database implemented in PHP without any third-party dependencies that store data in plain JSON files.

It is not designed to handle heavy-load IO operations, it is designed to have a simple solution where all we need a database for managing a few gigabytes of data. You can think of it as a database for low to medium operation loads.

Features

  • ⚑ Lightweight, faster

    Stores data in plain-text utilizing JSON format, no binary conversion needed to store or fetch the data. Default query cache layer.

  • πŸ”† Schema free data storage

    SleekDB does not require any schema, so you can insert any types of data you want.

  • πŸ” Query on nested properties

    It supports schema free data, so you can filter and use conditions on nested properties of the JSON documents!

    where( 'post.author.role', '=', 'admin' )

    SleekDB will look for data at:

    {
      "post": {
        "author": {
          "role": "admin"
        }
      }
    }
  • ✨ Dependency free, only needs PHP to run

    Supports PHP 7+. Requires no third-party plugins or software.

  • πŸš€ Default caching layer

    SleekDB will serve data from cache by default and regenerate cache automatically! Query results will be cached and later reused from a single file instead of traversing all the available files.

  • 🌈 Rich Conditions and Filters

    Use multiple conditional comparisons, text search, sorting on multiple properties and nested properties. Some useful methods are:

    • where
    • orWhere
    • select
    • except
    • in
    • not in
    • join
    • like
    • sort
    • skip
    • orderBy
    • update
    • limit
    • search
    • distinct
    • exists
    • first
    • delete
    • like
    • not lik
    • between
    • not between
    • group by
    • having
  • πŸ‘ Process data on demand

    SleekDB does not require any background process or network protocol in order to process data when you use it in a PHP project. All data for a query will be fetched at runtime within the same PHP process.

  • 😍 Runs everywhere

    Runs perfectly on shared-servers or VPS too.

  • 🍰 Easy to learn and implement

    SleekDB provides a very simple elegant API to handle all of your data.

  • 🍰 Easily import/export or backup data

    SleekDB use files to store information. That makes tasks like backup, import and export very easy.

  • πŸ’ͺ Actively maintained

    SleekDB is created by @rakibtg who is using it in various types of applications which are in production right now. Our other contributor and active maintainer is Timucin who is making SleekDB much better in terms of code quality and new features.

  • πŸ“” Well documented

    The official documentation of SleekDB does not just provide a good api documentation. It is filled with examples!

Visit our website https://sleekdb.github.io/ for documentation and getting started guide.

Comments
  • Multiple Joins + Nested Joins cannot be used in combination

    Multiple Joins + Nested Joins cannot be used in combination

    Hi, @rakibtg , first of all, I want to thank you. Your work is amazing and really love it. Useful for mocking database before diving deep into mysql.

    I found an issue where I cannot make aggregation query multiple join + nested join.

    To give you the idea, this code will only query multiple joins, but not the nested join.

    $arr_user = $db_users->createQueryBuilder()
         ->join(function ($arr_user) use ($db_posts) {
             return $db_posts->findBy(['user_id', '=', $arr_user['_id']]);
         }, 'posts')
            ->join(function ($arr_user) use ($db_comments, $db_posts) {
                return $db_comments
                    ->createQueryBuilder()
                    ->where(['user_id', '=', $arr_user['_id']])
                    ->join(function ($arr_comment) use ($db_posts) {
                        return $db_posts->findById($arr_comment['thread_id']); //<---- This query will not work
                    }, 'post')->getQuery()->first();
            }, 'comments')
            ->getQuery()->first();
    

    If I take out the multiple joins, the nested join works, like in the example.

    $arr_user = $db_users->createQueryBuilder()
            ->join(function ($arr_user) use ($db_comments, $db_posts) {
                return $db_comments
                    ->createQueryBuilder()
                    ->where(['user_id', '=', $arr_user['_id']])
                    ->join(function ($arr_comment) use ($db_posts) {
                        return $db_posts->findById($arr_comment['thread_id']);
                    }, 'post')->getQuery()->first();
            }, 'comments')
            ->getQuery()->first();
    

    Do you have any ideas? Thank you πŸ‘πŸ»

    opened by sawirricardo 14
  • Better structure with namespaces. New like condition and select method. Updated orWhere and getStoreId method.

    Better structure with namespaces. New like condition and select method. Updated orWhere and getStoreId method.

    Hi, thank you for this nice project. I made some improvements. Should not interfere with any code using this SleekDB. Hope this can be merged or further improved before merging.

    A little summary:

    [ADDED] like condition with regex; ext-json to composer as required, because of json_encode and json_decode methods; own file for every exception class, for better structure and easier usage outside of SleekDB; namespaces to Traits and Exceptions; [UPDATED] file names of traits; folder structure; [FIXED] missing @throws tags; wrong behavior of verifyWhereConditions method if condition is not matched by any if statements;

    opened by Timu57 10
  • CLI

    CLI

    Added a CLI for managing stores and records. Since this is still a work in progress, I was just hoping to get some feedback before i go about implementing the other functions, let me know what you think!

    enhancement 
    opened by amcquade 10
  • Please add Group BY Method

    Please add Group BY Method

    Sometimes it is necessary to group your data and it takes time to write grouping manually. Looking forward to have grouping in SleekDB and thank you for this awesome product!

    discussion feature release candidate 
    opened by dvygolov 9
  • update return value

    update return value

    The update function returns true even when the underlying file_put_contents return false due to security permissions. So, nothing where updated in the register but update returns true, see PHP log Warning:

    [Sat Nov 21 01:24:51.072446 2020] [php7:warn] [pid 1870] [client 111.111.111.111:1234] PHP Warning: file_put_contents(/home/user/data//278.json): failed to open stream: Permission denied in /php/utils/SleekDB/SleekDB.php on line 100

    Maybe, update should return FALSE in such case.

    Thanks.

    bug release candidate 
    opened by BLLuis 8
  • Multiple where() condition doesn't work

    Multiple where() condition doesn't work

    Hello there,

    I have a problem with multiple where() conditions for my DB, I have start and end dates for my news article, I'm trying to do following to select 'active' news item:

    $news = $newsStore
            ->orderBy( 'asc', 'order' )
            ->where( 'startDate', '<', time() )
            ->where( 'endDate', '>', time() )
            ->fetch();
    

    Looks like first condition is completely ignored and only second one is applied.

    Any help please?

    opened by snoopy4ever 8
  • Dont Delete this Function!

    Dont Delete this Function!

    Hi there! It is always a pleasure to talk about this project, it is incredible.

    I would like to know, if there is the possibility of keeping the function ''' where()->update ''' as a quick and practical option to an Update.

    discussion 
    opened by aaferna 7
  • Uncaught SleekDB\Exceptions\InvalidConfigurationException: cache_lifetime has to be null or int

    Uncaught SleekDB\Exceptions\InvalidConfigurationException: cache_lifetime has to be null or int

    test

    I got this message when trying to add configuration parameters

    this is the code that caused the issue

    require_once DIR.'/plugins/SleekDB/Store.php';

    $dbDir = $_SERVER['DOCUMENT_ROOT']."/db/";
    $configuration = [
    "auto_cache" => true,
    "cache_lifetime" => null,
    "timeout" => 120
    

    ];
    $newsStore = new \SleekDB\Store("news", $dbDir, $configuration);

    bug 
    opened by REDAL 7
  • Unique insert

    Unique insert

    Can we implement unique insert, so it will search for duplicate key/value in document, and if it not exist, it will insert the document or it will throw error.

    discussion 
    opened by daussho 6
  • Add a new method for nested where conditions

    Add a new method for nested where conditions

    As pointed out by @adrxn in https://github.com/rakibtg/SleekDB/issues/80#issuecomment-763671096 the current implementation does not support nested where clauses.

    The new method should accept an array like this:

    [
      "and" => [
        "and" => [
          [
            "or" => [
              [ "name", "like", "a%" ],
              [ "name", "like", "b%" ]
            ]
          ],
          [
            "or" => [
              [
                "and" => [
                  [ "age", ">=", 16 ],
                  [ "age", "<", 20 ]
                ]
              ],
              [
                "and" => [
                  [ "age", ">=", 24 ],
                  [ "age", "<", 28 ]
                ]
              ]
            ]
          ]
        ]
      ]
    ];
    

    To provide the following request:

    WHERE ( (name like 'a%' OR name like 'b%') AND ((age >= 16 AND age < 20) or (age >= 24 AND age < 28)) )
    

    Array structure / Concept

    "OUTERMOST_OPERATION" => [
      "OPERATION_DEPTH_1" => [
        [
          "OPERATION_DEPTH_2" => [
            ["CLAUSE"],
            "OPERATION_DEPTH_3" => [
              ["CLAUSE"],
              ["CLAUSE"]
            ]
          ]
        ]
    ]
    

    OUTERMOST_OPERATION

    The outermost operation is optional and does specify how the given conditions are connected with other conditions, like the ones that are specified using the where, orWhere, in or notIn methods. If this operation is not given it will default to an AND operation.

    Because the outermost operation represents the connection of the given conditions towards the "outer world" it has to have one child element that specifies the OPERATION_DEPTH_1.

    Meaning the following array will not be allowed and will throw an error:

    "or" => [
      [ "name", "like", "a%" ]
    ];
    

    OPERATION_DEPTH_X

    To specify a nested condition these operations are mandatory. They also have to have at least two children to be of any use. The children-amount >= 2 should not be enforced by SleekDB.

    If you have for example the following array as a "conditions array" it should work without errors. Unfortunately it will not bring much additional functionality because it can also be done with a simple orWhere call:

    "or" => [
      "and" => [
        [ "name", "like", "a%" ],
      ]
    ];
    
    WHERE ( name like "a%" ) OR ...
    
    discussion feature release candidate 
    opened by Timu57 6
  • Better search algorithm

    Better search algorithm

    Hi,

    first of all great work and project.

    It looks like the build in similar_text() function is not perfect.

    I just made some little tests, but it looks like the returned percentages are not always what I expected.

    It would be awesome if we can add some his string normalization: https://stackoverflow.com/questions/35923029/similar-text-percentage-in-php

    I have implemented several algorithms that will search for duplicates and they can be quite similar.
    
    The approach I am usually using is the following:
    
        normalize the strings
        use a comparison algorithm (e.g. similar_text, levenshtein, etc.)
    
    It appears to me that in implementing step 1) you will be able to improve your results drastically.
    
    Example of normalization algorithm (I use "Sponsors back away from Sharapova after failed drug test" for the details):
    
    1) lowercase the string
    
    -> "sponsors back away from sharapova after failed drug test"
    
    2) explode string in words
    
    -> [sponsors, back, away, from, sharapova, after, failed, drug, test]
    
    3) remove noisy words (like propositions, e.g. in, for, that, this, etc.). This step can be customized to your needs
    
    -> [sponsors, sharapova, failed, drug, test]
    
    4) sort the array alphabetically (optional, but this can help implementing the algorithm...)
    
    -> [drug, failed, sharapova, sponsors, test]
    
    Applying the very same algorithm to your other string, you would obtain:
    
    [australian, drugs, failed, maria, open, sharapova, test]
    
    This will help you elaborate a clever algorithm. For example:
    
        for each word in the first string, search the highest similarity in the words of the second string
        accumulate the highest similarity
        divide the accumulated similarity by the number of words
    
    

    And/Or add some math from MySQLs Fulltext-Search score algorithm: https://dba.stackexchange.com/questions/111738/mysql-match-relavancy-score

    Relevance is computed based on the number of words in the row, the number of unique words in that row, the total number of words in the collection, and the number of documents (rows) that contain a particular word.

    Add custom ranking key property to result

    That ranking key can then be used in orderBy to sort the result.

    enhancement release candidate 
    opened by Timu57 6
  • JSON Wildcard Notation

    JSON Wildcard Notation

    Hi!

    Here's an example of a JSON document that's inserted into a store called 'search_index'.

    "title" : "Group 1",
    "soc" : [{
       "1234" : {
          "job_title" : "Computer Programmer",
          "job description" : "Computer science description"
       },
       "4567" : {
          "job_title" : "Computer Analyst",
          "job description" : "Computer analyst description"
       }
    }]
    

    I'm trying to setup a search fetch using the code below:

    $search_fields = array( "title", "soc.*.job_title", "soc.*.job description" );
    $relevance_params = array( "relevance" => "DESC" );
    $sleekdb_data = $store->search( $search_fields, $input["slug"], $relevance_params );
    

    I want "job_title" and "job description" fields (which are sub-fields of "SOC") to be used as fields to search for, using JSON notation as described in the documentation. However, the sub-fields are always different numbers so I'd like to use something like a wildcard notation. I'm not getting any results so it's obviously not working. Is there a way to include the two sub-fields, along with the "title" field?

    feature 
    opened by jholmes001 1
  • Allow to use UUIDs as primary keys

    Allow to use UUIDs as primary keys

    At this moment in time primary keys have to ne numeric:

    The id of the document has to be numeric

    I like to use https://github.com/ramsey/uuid to generate UUIDs for my entities, but I'm not able to use them as my primary key because they are not numeric. Is there a reason why there's such a restriction?

    question discussion feature 
    opened by robiningelbrecht 2
  • SleekDB Extension of builtin

    SleekDB Extension of builtin "named functions" by users

    Hi SleekDB Community, what do you think of, applying given functions on selected columns, for example, I need to use hash sha256 on '_id'

    could/should be available for "select", "insert" etc.

    container->createQueryBuilder()->select(["hashed_id" => hash("sha256", "_id"), "username"])->getQuery()->fetch();

    rather than, saving a new column with hashed data, or remapping the array, when returned and adding the hashed values

    of course, the idea is to apply, any given declared and existing function within your code, and it's not only for hash, your imagination is the limit

    for example, tell sleekdb to hash the column on creating, or search a column with hash content,

    like, ->where(hash("sha256", "userid"), "=", "hash")

    WHERE "userid" is a column within the database

    discussion feature 
    opened by REDAL 0
  • simple join approach

    simple join approach

    Hi SleekDB community,

    I did found a library that use a simpler approach for joins ,

    $users = $db->collection('Users'); $comments = $db->collection("Comments"); $users->where('id', '=', '1')->join($comments, 'user_id', 'id')->fetchArray()

    what do you think to implement it like that in a future release?

    credits : dwgebler

    @Timu57 @rakibtg

    enhancement discussion 
    opened by REDAL 0
  • [Suggestion] Add support for JSON_PRETTY_PRINT

    [Suggestion] Add support for JSON_PRETTY_PRINT

    While developing, I often need to check the results inside the JSON. In bigger files, it's hard to keep an overview. So, I suggest adding the option JSON_PRETTY_PRINT (by default deactivated). Any thoughts?

    discussion feature 
    opened by basteyy 2
  • When can we expect encryption

    When can we expect encryption

    I'm currently working on a project where i want to use SleekDB. i want to store data with encryption. I know you are working on encryption but when can i expect that. For now i am setting Directory permission to owner only. But having encryption too will enhance security.

    opened by sheikhhaziq 0
Releases(2.15)
  • 2.15(Oct 16, 2022)

  • 2.14(Sep 28, 2022)

  • 2.13(Oct 10, 2021)

  • 2.12.1(Jul 31, 2021)

  • 2.12(Jul 11, 2021)

  • 2.11.1(Jun 16, 2021)

  • 2.11(May 30, 2021)

  • 2.10.2(May 30, 2021)

  • 2.10.1(Apr 12, 2021)

    Fixed bug in cache token generation

    • Function string representation now include static scope variables.

      This is important for creating a different cache token, if the value of a variable in the static scope changes.
    Source code(tar.gz)
    Source code(zip)
  • 2.10(Apr 12, 2021)

  • 2.9(Apr 1, 2021)

    Changes from 2.8 to 2.9

    Source code(tar.gz)
    Source code(zip)
  • 2.8.2(Feb 24, 2021)

    • Fixed: Caching layer did not check read permissions before using glob function.

    • Fixed: Read permission was not checked before counting files in folder.

    Source code(tar.gz)
    Source code(zip)
  • 2.8.1(Feb 24, 2021)

  • 2.8(Feb 24, 2021)

  • 2.7.2(Feb 23, 2021)

  • 2.7.1(Feb 22, 2021)

  • 2.7(Feb 22, 2021)

    Changes from 2.6 to 2.7

    Source code(tar.gz)
    Source code(zip)
  • 2.6(Feb 17, 2021)

    Changes from 2.5 to 2.6

    • ✨ New functionality

    • 🌈 Improved functionality

      • select()

        For more details please visit the documentation of select.
        • The select method now accepts aliase!
        • When using select in conjunction with groupBy you can use functions!
        • You can now select nested fields!
      • except()

        For more details please visit the documentation of except.
        • You can now exclude nested fields!
      • update() of Query class

        For more details please visit the documentation of update.
        • You can now update nested fields!
        • Can now return the updated results!
    Source code(tar.gz)
    Source code(zip)
  • 2.5(Feb 11, 2021)

    Changes from 2.4 to 2.5

    ✨ New conditions:

    The following conditions can now be used with the findBy(), findOneBy(), deleteBy(), where() and orWhere() methods!

    • BETWEEN
    • NOT BETWEEN

    🌈 SleekDB now accepts DateTime objects to filter data!

    Visit our new "Working with Dates" documentation page to learn more about date handling.

    The methods that accept DateTime objects as a value to check against are:

    • findBy
    • findOneBy
    • deleteBy
    • where
    • orWhere

    The conditions you can use DateTime objects with are:

    • =
    • !=
    • >
    • >=
    • <=
    • IN
    • NOT IN
    • BETWEEN
    • NOT BETWEEN
    Source code(tar.gz)
    Source code(zip)
  • 2.4(Feb 10, 2021)

  • 2.3(Feb 10, 2021)

    Changes from 2.2 to 2.3

    🚨 Deprecated nestedWhere() method

    We are sorry to deprecate the nestedWhere() method so short after it's release. It will be removed with the next major update. Please use where() and orWhere() instead.

    🌟 Nested where statements everywhere!

    The findBy(), findOneBy, deleteBy(), where() and orWhere() methods now can handle nested statements!

    • findBy()
    • findOneBy()
    Fetch Data documentation
    • deleteBy()
    Delete Data documentation
    • where()
    • orWhere()
    QueryBuilder documentation

    ✨ New conditions

    The following new conditions can now be used with the findBy(), findOneBy(), deleteBy(), where() and orWhere() methods!

    • not like
    • in
    • not in
    • findBy()
    • findOneBy()
    Fetch Data documentation
    • deleteBy()
    Delete Data documentation
    • where()
    • orWhere()
    QueryBuilder documentation

    πŸ’‘ Logical connection

    All condition methods are now logically connected and the order when using them is now important. See #114 for more details.

    Issues

    • #112
    • #114
    • #117
    Source code(tar.gz)
    Source code(zip)
  • 2.2(Feb 8, 2021)

    Changes from 2.1 to 2.2

    Updated methods

    πŸ—ƒ Order by multiple fields

    Now the orderBy() method of the QueryBuilder accepts multiple fields to sort the result. Look at the updated orderBy section of the QueryBuilder documentation to learn more.

    New methods

    πŸ” New nestedWhere() method

    With the new added nestedWhere() method you can now use much complexer where statements to filter data. Look at the new nestedWhere section of the QueryBuilder documentation to learn more.

    Source code(tar.gz)
    Source code(zip)
  • 2.1.2(Feb 7, 2021)

    When creating the cache token, the join sub-queries were not considered correctly.

    Version 2.1.2 adds a private hash method for closures and uses that for the cache token generation.

    Fix of #105

    Source code(tar.gz)
    Source code(zip)
  • 2.1.1(Jan 31, 2021)

    Because of the new primary_key configuration the "field" property of the orderBy property got set automatically. That was not necessary because the execution method has an updated algorithm that already considers the property_key configuration. That caused a bug where SleekDB thinks that orderBy is used when it's not. #99

    Source code(tar.gz)
    Source code(zip)
  • 2.1(Jan 29, 2021)

  • 2.0.1(Jan 26, 2021)

  • 2.0(Jan 24, 2021)

    πŸ“’ Optimisations, new query methods and more control

    SleekDB 2.0 comes with so many important optimisations and other features that make it faster and more mature. This is the recommended SleekDB release version for new projects, and if you are using an older version consider upgrading as soon as possible.

    Special thanks to @Timu57 for his incredible contributions behind this release πŸ™

    Changes from 1.5 to 2.0

    • πŸ”Ž Improving document discovery process

      Added better file locking support with reduced nested loops for finding documents. Added methods that can be used to easily find a document without searching for entire available JSON files of a store.

    • Support for PHP >= 7.0

      The support of PHP 5 is dropped to provide more modern features.

    • ✨ New query methods

      • first()
      • exists()
      • select()
      • except()
      • distinct()
      • join()
      • findAll()
      • findById()
      • findBy()
      • findOneBy()
      • updateBy()
      • deleteBy()
      • deleteById()
    • Improved Code Quality

      We isolated most of the existing logics into different classes to make the codebase easy to understand and easy to maintain.

    • Unit Testing

      There was some concern among developers as it was lacking UNIT Testing, now its added!

    • SleekDB class now deprecated

      We beliefe that downwards compatibility is very important.

      That's why we always try our best to keep SleekDB as downwards compatible as possible and avoid breaking changes.

      Unfortunatelly we had to refactor and rewrite the whole SleekDB project to make it future proof and keep it maintainable. As a consequence the SleekDB class is now deprecated with version 2.0 and will be removed with version 3.0.

      A new era for SleekDB begins!

    • Better Caching Solution

      Data caching has been improved significantly.

      • Add custom expiry of a cache file with lifetime.
      • Ability of query specific caching rules.

    Issues

    • Deprecate SleekDB Class (#84)
    • first and exists methods does not use cache (#82)
    • Make where and orWhere just accept one array (#80)
    • Make dataDir required (#79)
    • Add update & delete to Store class #78)
    • Change delete method of Query class to accept return options (#77)
    • Add find methods to new Store class to make the QueryBuilder optional for simple queries. (#75)
    • Allow to query on read-only file system (#67)
    • Use "results" property instead of returning data from methods (#59)
    • Return the first item only (#56)
    • Check if data exists (#54)
    • update return value (#51)
    • delete status (#48)
    • Extend not possible due to private helper methods (#44)
    • JOIN feature (#42)
    • Return distincted value (#41)
    • Suppress Key on fetch (#38)
    • Like Condition (#34)
    • Better code base (#32)
    • OR Condition Query (#31)
    • Possibility of duplicate ID’s (#30)
    Source code(tar.gz)
    Source code(zip)
  • 1.5.1(Jul 31, 2020)

    Please update to version 1.5.1

    About the bug that has fixed:

    In some scenario it might skip some conditions on similar query:

      $stories = $newsStore
          ->where( 'country', '=', 'BRAZIL' )
          ->where('status','=','active')
          ->orWhere( 'country', '=', 'USA' )
          ->fetch();
    

    This is fixed now.

    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Aug 12, 2019)

    SleekDB 1.5.0 comes with few important optimizations and with other features that will make it more easier to manage data. This is a recommended update if you are using an older version of SleekDB.

    ✌️ No breaking changes from 1.0.3 to 1.5.0

    • πŸ’ͺ Improving document discovery process Starting from version 1.5.0 SleekDB will discover new documents without affecting the _id serializer, that means it will need to do a lot less work than before. That makes it more faster less memory hungry than ever before.
    • 🐍 orWhere() clause method It will work as the OR condition of SQL. SleekDB supports multiple orWhere as object chain.
      $user = $usersDB->where( 'products.totalSaved', '>', 10 )
          ->orWhere( 'products.totalBought', '>', 20 )
          ->orWhere( 'products.shipped', '=', 1 )
          ->fetch();
      
    • 😍 in() clause method It work like the IN clause of SQL. SleekDB supports multiple in() as object chain for different fields.
      $user = $usersDB
          ->in('country', ['BD', 'CA', 'SE', 'NA'])
          ->in('products.totalSaved', [100, 150, 200])
          ->fetch();
      
    • 😎 notIn() clause method It works as the opposite of in() method. It will filter out all documents that has particular data items from the given array. SleekDB supports multiple notIn as object chain for different fields.
      $user = $usersDB
          ->notIn('country', ['IN', 'KE', 'OP'])
          ->notIn('products.totalSaved', [100, 150, 200])
          ->fetch();
      
    • πŸ€— Keeping Query State If you want to keep the condition parameters for query and perform additional operations then you may want to use the keepConditions() method. Here is an example showing how you may fetch data and then update on the discovered documents without running an additional query:
      // Find documents.
      $result = $usersDB
          ->keepConditions() // Won't reset the active query state.
          ->where('products.totalBought', '>', 0)
          ->where('products.totalSaved', '>', 0);
      
      // Fetch data.
      $result->fetch();
      
      // Update matched documents.
      $result->update([
          'someRandomData' => '123',
      ]);
      
      
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Mar 21, 2019)

    ✌️ No breaking changes from 1.0.2 to 1.0.3

    • Update multiple records at once. - #7
    • Added deleteStore() API and fixed its namespace issue. - #6
    • Reset state on multiple store operations from a single store instance. - #5

    πŸš€ Please update to version 1.0.3 for this changes.

    Source code(tar.gz)
    Source code(zip)
Owner
Kazi Mehedi Hasan
maker.
Kazi Mehedi Hasan
ATK Data - Data Access Framework for high-latency databases (Cloud SQL/NoSQL).

ATK Data - Data Model Abstraction for Agile Toolkit Agile Toolkit is a Low Code framework written in PHP. Agile UI implement server side rendering eng

Agile Toolkit 257 Dec 29, 2022
The fastest pure PHP database framework with a powerful static code generator, supports horizontal scale up, designed for PHP7

Maghead 4.0.x IS CURRENTLY UNDER HEAVY DEVELOPMENT, API IS NOT STABLE Maghead is an open-source Object-Relational Mapping (ORM) designed for PHP7. Mag

Maghead 477 Dec 24, 2022
Database management in a single PHP file

Adminer - Database management in a single PHP file Adminer Editor - Data manipulation for end-users https://www.adminer.org/ Supports: MySQL, MariaDB

Jakub VrΓ‘na 5.5k Jan 1, 2023
Small script for importing the KvK (Dutch Chamber of Commerce) Open Data Set (CSV file) to a MySQL database.

KvK-CSV-2-SQL Small script for importing the KvK (Dutch Chamber of Commerce) Open Data Set (CSV file) to a MySQL database. Table of content KvK-CSV-2-

BASTIAAN 3 Aug 5, 2022
phpSleekDBAdmin - a web-based SleekDB database admin tool written in PHP

phpSleekDBAdmin is a web-based SleekDB database admin tool written in PHP. Following in the spirit of the flat-file system used by SleekDB, phpSleekDBAdmin consists of a single source file, phpsleekdbadmin.php. The interface and user experience is comparable to that of phpLiteAdmin and phpMyAdmin.

GalAnonym 8 Oct 26, 2022
A simple program to query mysql data and display the queried data in JSON format

A simple program to query mysql data and display the queried data in JSON format. The data displayed in JSON format will change and update as the data in your mysql database changes.

null 2 Mar 7, 2022
A Redis based, fully automated and scalable database cache layer for Laravel

Lada Cache A Redis based, fully automated and scalable database cache layer for Laravel Contributors wanted! Have a look at the open issues and send m

Matt 501 Dec 30, 2022
Laravel Code Generator based on MySQL Database

Laravel Code Generator Do you have a well structed database and you want to make a Laravel Application on top of it. By using this tools you can gener

Tuhin Bepari 311 Dec 28, 2022
Very easy to use PDO MYSQL API. Just Include in PHP file and get it working.

CRUD-MYSQL-API Very easy to use PDO MYSQL API. Just Include in PHP file and get it working. INSTALATION Step 1: git clone https://github.com/arhex-lab

Abdul Raheem 4 Jun 14, 2022
The lightweight PHP database framework to accelerate development

The lightweight PHP database framework to accelerate development Features Lightweight - Less than 100 KB, portable with only one file Easy - Extremely

Angel Lai 4.6k Dec 28, 2022
PHP Database Migrations for Everyone

Phinx: Simple PHP Database Migrations Intro Phinx makes it ridiculously easy to manage the database migrations for your PHP app. In less than 5 minute

CakePHP 4.3k Jan 7, 2023
A php class for managing and connecting to a database

Query builder class php This class is responsible for creating and executing sql commands and helps you to execute as easily as possible and safely. I

Mohammad Qasemi 39 Dec 11, 2022
Database lookup tool in php, skidlookup has not been claimed so if u want to use this src all right's go to u, idea came from fedsearch

skidlookup Database lookup tool in php, skidlookup has not been claimed so if u want to use this src, all right's go to u, idea came from fedsearch in

Nano 12 Dec 1, 2021
A complete, simple and powerful database framework written in PHP

BaseSQL BaseSQL is a complete database framework written in PHP. It was built to accelerate projects development by handle database connections and qu

Willian Pinheiro 2 Sep 21, 2021
Connect and work with MySQL/MariaDB database through MySQLi in PHP. This is an introductory project, If you need a simple and straightforward example that takes you straight to the point, you can check out these examples.

First MySQLi PHP Connect and work with MySQL/MariaDB database through MySQLi in PHP. The above exercises are designed for students. This is an introdu

Max Base 4 Feb 22, 2022
Database lookup tool in php, skidlookup has not been claimed so if u want to use this src all right's go to u, idea came from fedsearch

skidlookup Database lookup tool in php, skidlookup has not been claimed so if u want to use this src, all right's go to u, idea came from fedsearch in

Nano 12 Dec 1, 2021
PHP Reader for the MaxMind DB Database Format

This is the PHP API for reading MaxMind DB files. MaxMind DB is a binary file format that stores data indexed by IP address subnets (IPv4 or IPv6).

MaxMind 577 Dec 26, 2022
PHP application-level database locking mechanisms to implement concurrency control patterns.

PHP DB Locker Introduction PHP application-level database locking mechanisms to implement concurrency control patterns. Supported drivers: Postgres In

cybercog 3 Sep 29, 2022
A simple library for managing database connections, results pagination and building queries in PHP

PHP lions-software-database-manager This is a simple library for managing database connections, results pagination and building queries in PHP. Esta Γ©

Lions Software 0 Feb 7, 2022