eloquent 3.3.2 copy "eloquent: ^3.3.2" to clipboard
eloquent: ^3.3.2 copied to clipboard

eloquent query builder port from PHP Laravel

1.0.0 #

  • Initial version

1.1.0 #

  • implemented tryAgainIfCausedByLostConnection

1.1.1 #

  • fix bugs on detects_lost_connections

1.2.0 #

  • fix bugs and update dargres to 2.2.4

1.2.1 #

  • fix parameter type of column orWhere

2.0.0 #

  • implemented Connection pool with option to automatically reconnect in case of connection drop
final manager = Manager();
  manager.addConnection({
    'driver': 'pgsql',
    'host': 'localhost',
    'port': '5432',
    'database': 'database',
    'username': 'username',
    'password': 'password',
    'charset': 'latin1',  
    'schema': ['public'],
    'pool': true, //new
    'poolsize': 2, //new
    'allowreconnect': true, //new   
  });

2.0.1 #

  • fixes critical bug in version 2.0.0 that caused stack overflow, timeout parameters were removed from query execution methods

2.0.2 #

  • fix bug on set application_name to postgresql < 8.2

2.0.2 #

2.1.0 #

  • change dependencie postgres to my fork postgres_fork
  • add more tests

2.1.1 #

  • small improvement and optimization in postgres PDO implementation

2.1.2 #

  • remove print from disconnect() in Connection class

2.2.0 #

  • add fromRaw (sub-query as from), joinSub (method to join a query to a sub-query)

3.0.0 #

  • implemented support for mysql through the 'mysql_client' package and also implemented support for posgress with the postgres v3 package, now you can choose the driver implementation through 'driver_implementation': 'postgres_v3', in addConnection method

3.0.1 #

  • fix bug on query builder count()

3.1.2 #

  • fix bugs in lost connection detection to automatically reconnect. Updated postgres to 3.1.2 to be able to use the onOpen callback to configure connection settings like setting search path

3.2.0 #

  • fix bugs in onOpen callback to configure connection settings
  • improvements to README
  • implemented connection pool for 'postgres' (v2) driver_implementation

3.2.1 #

  • fix bug on format Schema

3.3.0 #

  • add option to decode timestamp without timezone and date as local DateTime and decode timestamp with timezone respecting the timezone defined in the connection for driver_implementation postgres

  • update postgres_v3 to ^3.5.4 With that dependency, upgraded minimum SDK to 3.4

  • change mysql_client to mysql_dart ^1.0.0

  • change postgres_fork ^2.8.4 to postgres_fork ^2.8.5

 final manager = Manager();
  manager.addConnection({
    'driver': 'pgsql',
    'driver_implementation': 'postgres_v3', // postgres | dargres | postgres_v3
    'timezone': 'America/Sao_Paulo',   
    // If true, decodes the timestamp with timezone (timestamptz) as UTC = default
    // If false, decodes the timestamp with timezone using the timezone defined in the connection.
    'forceDecodeTimestamptzAsUTC': false,
    // If true, decodes the timestamp without timezone (timestamp) as UTC.
    // If false, decodes the timestamp without timezone as local datetime.
    'forceDecodeTimestampAsUTC': false,
    // If true, decodes the date as UTC.
    // If false, decodes the date as local datetime.
    'forceDecodeDateAsUTC': false,
    'pool': true,
    'poolsize': 2,
    'host': 'localhost',
    'port': '5435',
    'database': 'siamweb',
    'username': 'dart',
    'password': 'dart',
    'charset': 'win1252',
    'prefix': '',
    'schema': ['public'],
    // require | disable
    //'sslmode' : 'require',
  });

3.3.1 #

  • fix bug on PgPool for PostgresV2PDO

3.3.2 #

Added #

  • onRaw(String sql) method to JoinClause: Adds support for raw SQL expressions as JOIN conditions. This is useful for complex scenarios that the standard on() method cannot handle, such as using database-specific functions or operators in the ON clause.

    Usage Example:

    db.table('processes')
      .join('listings as l', (JoinClause jc) {
        jc.onRaw("(processes.code || '/' || processes.year) = ANY(l.processes_array)");
      })
      .get();
    
  • clone() method to QueryBuilder: Creates a deep and independent copy of a query builder instance. This allows for the duplication of a query's entire state (including selects, joins, wheres, orders, and bindings) into a new object. Modifying the cloned query will not affect the original, making it ideal for creating variations from a base query.

    Usage Example:

    // 1. Create a base query for active users
    final baseQuery = db.table('users').where('status', '=', 'active');
    
    // 2. Clone it to create variations without affecting the original
    final usersCountQuery = baseQuery.clone();
    final firstUserQuery = baseQuery.clone();
    
    // 3. Use the clones for different purposes
    final totalActiveUsers = await usersCountQuery.count();
    final firstUser = await firstUserQuery.orderBy('created_at').first();
    
    // The original query remains untouched and can be reused
    final allActiveUsers = await baseQuery.get();
    
16
likes
140
points
359
downloads

Publisher

unverified uploader

Weekly Downloads

eloquent query builder port from PHP Laravel

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

collection, dargres, enough_convert, intl, meta, mysql_dart, path, postgres, postgres_fork

More

Packages that depend on eloquent