Skip to content

Releases: google/mug

Release 9.3

24 Oct 01:52

Choose a tag to compare

  • Dot Parse.
    • Easy, safe parser combinator library (no infinite loop possible).
    • Supports lazy, streaming parsing (jsonParser.parseToStream(Reader)).
    • Csv and regex parsers included.
    • Tiny — 1/5 the size of jparsec.
  • New StringFormat.format() overloads for more efficient formatting.

Release 9.2

08 Aug 06:08

Choose a tag to compare

  • SafeSql.queryForOne().
  • Supports public fields besides Java Beans.
  • {names? -> AND name IN (names?)}
  • BoundedConcurrency in mug-concurrent24. concurrently() as a higher-throughput mapConcurrent(). race().

Release 9.1

13 Jul 01:09

Choose a tag to compare

  • Automatic module names
  • Fixed accidental JDK 9 references

Release 9.0

12 Jul 19:00

Choose a tag to compare

Major release fixing dependencies.

  • SafeSql supports converting ResultSet into Java Beans and records.
  • Removed guava dependency from the mug-safesql artifact to help avoid jar hell.
  • Added mug-spanner artifact with ParameterizedQuery to offer safe templating for Cloud Spanner dynamic queries (no extra dependency other than mug and cloud spanner).
  • Fixed mug-guava split package by renaming packages to make it more friendly to JPMS
  • Moved CaseBreaker into Mug core artifact.
  • Split out the CaseFormat-dependent method into mug-guava as CaseFormats class.
  • Added optional template parameter support. For example:
    SafeSql.of("... {filter? -> WHERE filter?}", optionalFilter())

mug-root-8.7

19 Jun 21:11

Choose a tag to compare

Release 8.7:

  • SafeSql supports query(connection, Class) to query into List<T>.
  • Substring.consecutive(char)

Release 8.6

26 May 04:02

Choose a tag to compare

  • Substring.all() e.g. all(',').split(line)
  • SafeSql uses ESCAPE '^' for LIKE escaping

Release 8.5

15 Feb 18:09

Choose a tag to compare

  • {condition -> subquery} support for SafeQuery and SafeSql.
  • SafeSql.queryLazily() that returns Stream

Release 8.3

24 Dec 20:55

Choose a tag to compare

Simplified structured concurrency Fanout API:

  • concurrently() cancellable.
  • withMaxConcurrency(maxConcurrency).inParallel(...) cancellable.
  • concurrently() throws unchecked exception so is easy to use in Stream.

Release 8.2

10 Nov 22:18

Choose a tag to compare

Mug Core

  • Substring.RepeatingPattern supports matching from the middle of a string:
    word().repeatedly().match(input, fromIndex)

Mug Guava

  • SafeSql - an injection-safe dynamic SQL template for JDBC. User-friendly API supporting powerful yet intuitive dynamic SQL composition and parameterization:
    SafeSql usersByName(String who, @CompileTimeConstant List<String> columns) {
      return SafeSql.of("SELECT `{columns}` FROM Users WHERE name LIKE '%{who}%'", columns, who);
    }
    
    try (var connection = DriverManager.getConnection(...)) {
      // SELECT `id`, `name` FROM Users WHERE name LIKE '%Emma%'
      List<User> users = usersByName("Emma", asList("id", "name"))
          .query(connection, row -> new User(row.getLong("id"), row.getString("name")));
      ...
    }

Release 8.1

29 Sep 18:06

Choose a tag to compare

Core:

Guava Addons