Skip to main content

v5.0.0 (Upcoming)

5.0.0 is a major upgrade from 4.2.5. Dataway has been rewritten with an independent core, framework adapters, metadata providers, and a replaceable console. DataQL introduces a redesigned engine and extension API, and the SQL executor has been reimplemented. Upgrading requires changes to dependencies, configuration, Java APIs, and storage structures.

<dependency>
<groupId>net.hasor</groupId>
<artifactId>dataway-embedded</artifactId>
<version>5.0.0</version>
</dependency>

Web applications can choose a Spring, Solon, or Hasor adapter. Add the SQL executor and metadata provider as separate dependencies.

Changes​

Dataway rewrite​

  • Decoupled the core from Hasor. DatawayConfig holds configuration and Dataway creates services. Spring, Solon, and Hasor adapters integrate with their host containers and Web lifecycles.
  • Separated business APIs, management APIs, console resources, and documentation into four Web handlers with configurable paths. Business API, management, and documentation endpoints are enabled as needed.
  • Separated management from execution. AdminService manages drafts, state, publication, disabling, deletion, and history. ApiService lets Java code invoke published, enabled APIs by HTTP method and path or API ID.
  • Retained drafts, published snapshots, and history, with added revision conflict checks and atomic batch writes. Routes are identified by method and path; draft changes take effect externally after publication.
  • Rebuilt authorization: applications handle login, IdentityProvider supplies identities, and AuthorizationCheck checks operations. Preset identities provide no access, API access, read-only console access, or full administration.
  • Replaced execution extensions with AdminInterceptor and ApiInterceptor, supporting before/after processing, exception handling, and short-circuit returns. Contexts expose targets, operations, and identities; API interceptors also distinguish HTTP, debugging, and Java calls.
  • Unified API execution, console debugging, and Java invocation through DatawayEngine and DatawayQuery for parameter preparation, script execution, and result processing.

Metadata and transactions​

  • Separated JDBC and Nacos providers into dataway-meta-jdbc and dataway-meta-nacos. Applications select storage through ApiDataAccessLayer.
  • Added table, field, and Nacos entity name mappings to DatawayConfig. SCRIPT stores the original script; SQL scripts are compiled as fragments when queries are created.
  • Provided schema scripts for MySQL, PostgreSQL, Oracle, SQL Server, and H2. JDBC batch writes use independent transactions by default and can join host transactions through framework-specific JdbcExecutor adapters.
  • Nacos uses configuration snapshots and CAS for version consistency, with support for reading the previous layout during migration.
  • Business SQL connections and metadata transactions are configured separately. Spring, Solon, and Hasor adapters connect ordinary SQL, tran.* functions, and application transactions.

Requests, results, and console​

  • Unified JSON, URL-encoded form, and multipart parsing, including repeated form fields, uploads, and parameter wrapping. Upload storage has configurable memory thresholds and temporary directories, with cleanup after requests.
  • Connected Web functions to the current request and response for Header/Cookie access and uploaded files. HTTP objects are passed through query context and cleared after execution.
  • Added BinaryModel for binary values in scripts and file responses.
  • Unified response output through ResultHandler, with Structure, Raw Value, CSV, Text, and Verify Code handlers. Supports a default handler, handler-specific defaults, and per-API options; custom handlers control status, headers, and body.
  • Migrated and upgraded console components while retaining editing, debugging, publication, and history operations. Results support JSON, text, table, and image previews and file downloads.
  • Packaged console resources as dataway-embedded-web, supporting separate builds, replacement, and frontend/backend deployment. initializer.js configures backend URLs; development supports Mock and proxy modes.
  • Reimplemented documentation generation with OpenAPI 3.0 and Swagger 2.0 endpoints. Only published, enabled APIs are exported and can be invoked through Swagger UI.

DataQL engine​

  • Extracted dataql-engine, with queries created through HostConfiguration → QueryManager → QueryBuilder → Query, supporting standalone use and JSR-223.
  • Reorganized Finder, resource loading, application object imports, function libraries, and external fragments. SPI discovers extensions; host attachments provide shared services.
  • Unified UDF arguments as UdfParams. setHint(String, Object) passes object references, and CustomizeScope provides custom scopes. Dataway merges request parameters with defaults.
  • Moved general function libraries into the engine. Web functions are supplied by Dataway; SQL and transaction functions are supplied by the SQL executor.
  • Corrected operator precedence and short-circuit evaluation, comments, negative numbers, scientific notation, string escaping, fragment arguments, and nested function exits.
  • Fixed Hint propagation, query cloning, Lambda scope restoration, collection indexing and callbacks, string functions, and HMAC algorithm selection.
  • Fixed character, enum, and numeric-to-boolean conversions, missing object fields, and numeric width Hint defaults.

SQL executor​

  • Introduced the independent dataql-sqlproc module, reimplemented using dbVisitor dynamic SQL, type handling, and dialect capabilities. Supports SQL, XML tags, batch execution, stored procedures, multiple results, and pagination.
  • ConnectionProvider supplies default or named data source connections. TransactionalProvider adds transaction support, including propagation, isolation, and transaction functions.
  • Added extension points for SQL execution interceptors, shared fragments, rules, type handlers, and pagination dialects.
  • Expanded positional and named parameters, text substitution, rule arguments, and parameter options. Added CASE/WHEN/ELSE and PAIRS rules, and fixed nested expressions, quotes, commas, and parameter marker escaping.
  • Added dialects for Hive, ClickHouse, MongoDB, Elasticsearch, and Milvus, and fixed pagination metadata synchronization and repeated queries. Non-relational sources require the corresponding dbVisitor JDBC driver.
  • Adapted type handling to the DataQL data model, including list-to-JDBC-array binding and JSON, binary, and vector conversion. Fixed CHAR/NCHAR truncation, result type detection, and time zone offset handling.
  • Simplified TypeHandler, retaining explicit registration and parameter-level configuration while removing inapplicable Java mappings and handlers. Fixed XML trim handling and SQL Hint defaults.

Build, examples, and documentation​

  • Established an independent repository with Gradle builds. Engine, SQL, console, framework adapters, and storage providers are published separately; example applications use Maven.
  • Unified JSON utilities on Jackson. Upgraded Cobble to 5.0.4, dbVisitor to 6.8.2, and Hasor to 5.3.0. The SQL executor bundles and relocates OGNL to reduce application dependency conflicts.
  • Added Spring, Solon, Hasor, Spring + Nacos, and DataQL transformation examples covering authentication, multiple data sources, transactions, forms, uploads, result handlers, and Swagger UI.
  • Expanded engine, DAL, function, storage, and Web request tests. Framework tests start real Boot servers and verify integration through HTTP; executable documentation tests validate examples.
  • Reorganized Chinese and English documentation, SQL references, blog posts, and migration guidance, with a llms.txt documentation index.

Upgrade notes​

  • Dependencies and configuration: capabilities from hasor-dataway, hasor-dataql, and hasor-dataql-fx are split across the new modules. Replace dependencies and configure endpoints, storage, and identities using the integration guides. Do not mix both runtimes.
  • Java and SPI: use AdminService for management and ApiService for published API calls. Migrate execution and serialization SPI implementations to interceptors and result handlers; integrate login through IdentityProvider.
  • Engine extensions: update UDF signatures to UdfParams and adapt Finder, fragment, and host configuration APIs. Recompile original scripts instead of reusing previously generated QIL.
  • Metadata: back up storage and preserve API IDs, original scripts, and publication history. Add revision and route constraints. Map SCRIPT_ORI when it contains the original script, and handle the Nacos layout change separately.
  • Responses: select output with defaultResultHandler and the API-level resultHandler option. Response templates belong to the Structure handler. Check default envelopes, failure responses, binary output, and custom handlers.
  • SQL extensions: TypeHandler now uses Object arguments and return values; AbstractTypeHandler<T> retains generics. Register handlers through TypeHandlerRegistry.register(...); mapping annotations and the javaType parameter option are removed.

See the Dataway architecture, API, and data migration guide for interface mappings, configuration examples, and migration steps.