Changelog
What changed in each package, newest first. This page is made from the
CHANGELOG.md files in the repo when the docs are built.
dox_annotation
3.0.0-alpha.5
- New
timestampsoption on@DoxModel.timestamps: falseturns offcreated_atandupdated_at, like$timestamps = falsein Laravel.createdAt: nullorupdatedAt: nullturns off one of them. - New
primaryKeyTypeoption on@DoxModel. UseprimaryKeyType: Stringfor a UUID key. The default isint. - Fix:
IHttpException.toResponse()now returns{"code": errorCode, "message": message}for a text message, so the client gets theerrorCode. AMapmessage is returned as it is.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
- OpenAPI annotations, all optional:
@Summary,@Description,@Tags,@Request,@Body,@Query,@Response,@ApiDeprecated,@ApiIgnore,@DoxController. Lower case names work too (@summary(...)), except@Response. - The DTO annotations (
@Dto,@Length,@Email, ...) live indox_validation.dox_coreexports them. IDoxRequesthas novalidate()and noprocessInputMapper()any more. Use a DTO.- Breaking (small): these names are exported by
dox_coretoo. If a file also imports a package with aRequestorResponseclass (likepackage:http) without a prefix, add a prefix to that import. - New
@DoxEnv()and@EnvKey('X')for the typed env class.
3.0.0-alpha.1
- Version 3 of Dox. All Dox packages now share one version.
- Needs Dart 3.6 or newer.
- See the release notes for all main changes.
dox_auth
3.0.0-alpha.5
- Breaking:
JwtAuthDriver.expiresInis 1 hour by default. Before, it wasnull, and tokens never expired. - New: named guards work. Use
Auth(guard: 'admin')andAuthMiddleware(guard: 'admin'). Before, onlydefaultGuardwas used. - A token keeps its guard name in the
audclaim. A token from one guard does not work on another guard. verifyTokenchecks theissclaim whenissueris set.- Breaking:
AuthDrivermethods get the guard name as a new parameter.AuthEngine().guard(name)replacesAuthEngine().driverandAuthEngine().provider.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
dart_jsonwebtoken3.4 (pointycastle4).
3.0.0-alpha.1
- Version 3 of Dox. All Dox packages now share one version.
- Needs Dart 3.6 or newer.
- See the release notes for all main changes.
- Uses
dox_orm(wasdox_query_builder). dart_jsonwebtoken3.
dox_builder
3.0.0-alpha.5
@DoxModel(timestamps: false)makes a model withoutcreatedAtandupdatedAt.createdAt: nullorupdatedAt: nullturns off only one.- The primary key field has the type of
@DoxModel(primaryKeyType: ...). It was alwaysint?. The default is stillint. The OpenAPI model schema uses the same type. - Fix: a preloaded relation with a two word name (like
userInfo) was missing fromtoJson(). The generator looked foruser_infoin the preload list, but the list hasuserInfo. - Fix: the OpenAPI route scanner now puts one
/between a group and a route path, like the router does.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
- New builder
dox_builder:openapi. It writeslib/openapi.g.dartwith the OpenAPI docs of the app: it reads theRoute.*calls, the controllers, the@Dtoclasses and the models. It writes nothing when the package has no controllers. DtoJsonSchema,ModelSchemaandJsonSchemaReader: the JSON Schema of a@Dtoclass, a model or any Dart type. Other builders can use them.- New: the DTO generator. For each
@Dtoclass it writes$<Name>Dto(aconst DtoSchema<Name>) into the.g.dartpart: plainifchecks per field, the converter,fromMap,toMapand the JSON Schema. It stops the build with a clear error for a bad DTO (a field that is not final, a type that is not supported, a rule that does not fit, a bad regex, ...). - New builder
dox_builder:dtos. It writeslib/dtos.g.dartwith every DTO of the app, forAppConfig(dtos: dtos). Two DTOs with the same name stop the build. DtoReader: the one place that knows DTO keys. The OpenAPI docs use the same keys as the DTO (snake_case by default,@Name,@Dto(keyCase:)).- OpenAPI:
@Regex(was@Pattern).@Formatis removed. Form requests are removed. - Fix: the OpenAPI route list has the full path, with the
Routerprefix andRoute.group()prefixes. Two'/'routes in two groups now each get their docs. - OpenAPI path params: every positional argument that is not the request and not a DTO.
- New:
@DoxEnv()classes get_$<Class>in the.g.dartpart. Each getter is read from the env once, converted to its type (String, int, double, num, bool, Uri, Duration, enum, List) and kept in a final field. A getter body is the default. A nullable getter is optional. load()throws oneEnvExceptionwith every missing or bad key.
3.0.0-alpha.1
- Version 3 of Dox. All Dox packages now share one version.
- Needs Dart 3.6 or newer.
- See the release notes for all main changes.
- Works with analyzer 5 and 6.
dox_cache
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- New:
getRaw(key)gives the stored value as JSON text, with no decode. Use it to send a cached value as a JSON response. Memory and Redis return the stored text as is. A stored String comes back with its quotes ("bar"). The stored format did not change, so old values still read the same. - Faster
get: a plain store builds the key with no async step.itemKeynow returnsFutureOr<String>. Memorygetcosts about 0.6 µs instead of 0.86 µs. MemorygetRawcosts about 0.3 µs. - New Redis option
pool_size: the most connections one store opens (ioredismaxConnection). Default is 10, the same as before. - Uses
ioredis2.0.0-alpha.2. It sends all commands on one shared connection and writes them together (auto-pipelining). A Redis read costs much less CPU. The cache now uses one connection per store, sopool_sizerarely matters.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
3.0.0-alpha.1
- Uses
ioredis2. Redis error replies throwRedisError. - Redis: no value size limit by default (was 60 KB).
maxValueBytesis still there if you want one. - Redis:
manyuses oneMGET,putManyuses one pipeline,flushusesSCAN+DEL(no Lua). - First release.
CacheManagerwith named stores and custom drivers.- Drivers: memory (with LRU), file, Redis, null.
remember,pull,add,increment,many, tags and atomic locks.
dox
Unreleased
- Fix:
dox key:generatedropped.envlines with more than one=(likeDATABASE_URL=postgres://u:p@h/db?sslmode=require). It also dropped comment lines. Now it only changes theAPP_KEYline. Every other line stays as it is. - Fix:
dox createcrashed withFailed to decode data using encoding 'utf-8'when the template had a binary file (for exampledb/dox.sqlite-shm). It now skips files that are not UTF-8 text. It only writes a file when its content changes.
3.0.0-alpha.5
- Fix:
dox create my_appwithout--versioncrashed with aRangeError. - Fix:
dox createpicked the GitHub "latest" template release, which skips pre-releases. During the 3.x alpha that gave the old 2.x template. It now takes the newest template with the same major version as the CLI. - Fix:
dox env:generatereadKEY=3000 # noteas text, not as anint. A#after a space is now a comment. - Fix:
dox updateran a plaindart pub global activate dox, which skips pre-releases. During the 3.x alpha it installed the old 2.x CLI. It now installs the newest version with the same major version as the CLI, from the pub.dev version list.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Fix:
dox buildno longer passes--delete-conflicting-outputsto build_runner (it was removed and printed a warning). - Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
dox buildnow runsdart build cli(AOT, with build hooks). The output isbuild/bundle/. Start it withcd build/bundle && ./bin/server.- New
dox create:dto <name>: makeslib/app/http/dtos/<name>.dto.dart.dox create:requestis removed. dox create:controller -rusesint idfor the resource methods.- New
dox openapi:generate [dir]. It runs the app'sbin/openapi.dartand writesopenapi.jsonandopenapi.yaml(defaultstorage/openapi). - New
dox env:generate: makeslib/config/env.dart(the typed env class) from.env.example. - New
dox env:check: loads the typed env and prints every missing or bad key (exit code 1).
3.0.0-alpha.1
- Version 3 of Dox. All Dox packages now share one version.
- Needs Dart 3.6 or newer.
- See the release notes for all main changes.
- Generated models import
package:dox_orm/dox_orm.dart.
dox_core
3.0.0-alpha.5
- Fix: CORS
origincan be a list. Dox compares the requestOriginwith the list and sends back only the origin that matches, or no header. Before, it joined the list with commas, and browsers rejected it. A list also sendsVary: Origin. - Breaking:
AESEncryptornow uses AES-GCM with a random nonce for each message. Before, it used AES-CTR with an all-zero nonce and no message check. Old encrypted cookies and values can not be read. - Breaking:
AESEncryptor.decodethrowsDecryptException(400) when the text was changed or the key is wrong. Before, it printed an error and returned''. req.cookie()returnsnullfor an encrypted cookie that can not be decrypted.- Fix:
Hash.verifyreturnsfalsefor a malformed hash. Before, it threw. AESEncryptorandDecryptExceptionare now exported frompackage:dox_core/dox_core.dart.- Fix: in
.env,KEY=value # notegave the valuevalue # note. A#after a space now starts a comment. A#inside quotes, or with no space before it, is kept. - Fix: the
.envparser removed every quote character inside a value. Now only the quotes around the value are removed. - Fix:
HEADrequests got 404, alsoHEAD /docs. AHEADrequest now runs theGETroute of the same path. The answer has the status and headers ofGET, with no body. - New: Dox listens on
PORTwhenAPP_PORTis not set. Cloud Run, Fly, Render and Heroku setPORT.APP_PORTstill wins. - New:
AppConfig.hostand the env varAPP_HOSTpick the network interface to listen on, like127.0.0.1. The default is the same as before: all interfaces (::, IPv6 and IPv4). - Fix: the start log always said
http://127.0.0.1:<port>. It now shows the real host and port, likehttp://[::]:3000. - Removed the unused
sprintfdependency. - New: graceful shutdown. On
SIGTERMorSIGINTevery isolate stops taking new connections and lets open requests finish, up toAppConfig.shutdownTimeout(default 8 seconds). Then Dox runsDoxShutdownservices and exits with code 0. Before, open requests were cut. A second signal stops at once. - New:
DoxShutdown. A service that also implements it getsshutdown()in every isolate on stop, to close connections. - New:
await Dox().stop()stops the server gracefully in every isolate, without exit. - Fix: an
s3storage disk withoutbucket,keyorsecretfailed withNull is not a subtype of String. Now it fails with a clear message that names the missing setting. - Fix: a URL with no route now answers like a thrown
NotFoundHttpException. The body is JSON ({"code": "not_found", "message": "GET /x not found"}), and the appresponseHandlerruns for it, so apps can format it. - Fix: the error answer of an
IHttpExceptionnow has itserrorCode. A text message gives{"code": "<errorCode>", "message": "<text>"}as JSON. Before, the body was plain text anderrorCodewas never sent. AMapmessage (like validation errors) is still sent as it is. - Fix: the
Loggernow readsLoggerConfig.level. Lines below that level are not printed. Levels from low to high:debug,info(andsuccess),warn,error(anddanger). - Fix:
Route.group('blogs')withRoute.get('all')made/blogsall. Path parts now join with one/. This also works for nested groups,Route.prefixandRoute.resource. - Fix:
Route.resourcehid every error from the controller. Now it only skips methods the controller does not have.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- New:
Cache().getRaw(key)gives the cached value as JSON text, with no decode. Send it as a JSON response with no extra encode step. - New Redis cache option
pool_size(seedox_cache).
3.0.0-alpha.2
- New default server:
dox_http_native(Rust hyper parses HTTP, your code stays in Dart). Hello world goes from about 41k to about 144k req/s on one isolate. Setserver: ServerBackend.dartIoinAppConfig(orDOX_SERVER=dartio) to usedart:io. Dox usesdart:ioby itself, with one warning line, when the native library does not load, and for apps with WebSocket or Socket.IO routes. - Faster requests: a simple
GEThello world went from about 31k to about 40k req/s on one isolate (plaindart:iois about 46k). A request with no body and sync middleware and controller now runs with noFuture.req.ip(), the query,req.all()and cookies are read on first use only. Reading the client ip was the biggest cost, because it asks the socket. Clean paths skip the two regex calls, and plain routes are found with a map lookup. - Fix: a
@Dtobody with aRequestFilefield shows asmultipart/form-datain the OpenAPI docs. - Fix:
req.ip()gave::ffff:127.0.0.1for IPv4 clients. Now it gives127.0.0.1. The same goes forX-Forwarded-Forhops. - Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
- Removed the
encryptpackage (not maintained, and it blockedpointycastle4). AES for cookies and the file cache now usespointycastle4. The output is the same, so old cookies and cache files still decode. - Fix:
Env.get()of a missing key with no default gave the text"null". A missingAPP_KEYbecame the key"null", which anyone can guess. NowStringgives'',String?givesnull, andint/num/double/boolthrow a clear error. New:Env.get<bool>(). - Startup stops with an error when
APP_KEYis empty andAPP_ENV=production. Other environments log a warning. - New: typed input with DTOs. A controller asks for a
@Dtoclass by type:store(CreateUser body). Dox reads the body (or the query forGET), checks it, and answers422with{"items.1.quantity": "..."}when it is wrong.await req.validate<T>()does the same inside a method. See the Validation guide. - New:
AppConfig(dtos: dtos)(fromlib/dtos.g.dart) andAppConfig(validationMessages:)for other languages.req.localeis the firstAccept-Language. - New: typed controller parameters.
DoxRequestanywhere, one@Dto, andString,int,double,num,boolpath params by position. A path param that does not fit its type answers404. The types are read once at start; an unknown type stops the server with a clear error. - New: optional path params
{id?}. - New: query strings and form data with repeated keys (
tags=a&tags=b) and bracket keys (address[city],items[0][name]) for DTOs. - A DTO answers
400for a body that is not valid JSON, and415for a body type it can not read. RequestFileimplementsFileInputand keeps its first bytes, so@Mimesand@Imagecheck the real file type.- Breaking: removed
req.validate(Map),req.validateAsync(),FormRequest,AppConfig(formRequests:),DoxValidator,IocContainer.registerRequest()andprocessInputMapper(). Use a DTO.req.validateSchema(schema)stays for input you only know at runtime. - Breaking: a controller with more path params than the route has
{...}params stops the start. Before, the extra ones got''. - Fix: a typed path param like
int idgave a 500 (it was always aString). - A
ValidationExceptionfromdox_validation(for exampleschema.parse()in a controller) answers 422. dox_coreexportsdox_validation(not itsValidationException), with the DTO annotations.dox_ormalso hasSchema, andpackage:uuidhasUuid: usehideor a prefix in a file that needs both.- Breaking:
Cache()runs ondox_cache.AppConfig.cacheis adox_cacheCacheConfig(defaultStore:, stores:)with option maps.CacheDriverInterfaceandFileCacheDriverare removed. Values must be JSON types.putwithout a duration keeps the value forever (was 1 hour). New:add,pull,increment,decrement,remember,rememberForever,lock,tags. - Breaking:
Storage()runs ondox_storage.AppConfig.fileStorageis nowAppConfig.storage(StorageConfig(defaultDisk:, disks:)with option maps forlocal,s3,memory).StorageDriverInterfaceandLocalStorageDriverare removed. An unknown disk name throws. Storage().stream()anddownload()stream from any disk (S3 too), withContent-Length. New:url,signedUrl,use()for the fullDisk.- New
Route.files('files')serves local signed URLs (403 for a bad signature). New catch-all route param{path*}. - OpenAPI:
AppConfig(openApi: OpenApiConfig(...))adds/docs,/openapi.jsonand/openapi.yaml. On by default only whenAPP_ENVis development or local. Bodies come from the routebody:option or a DTO.Dox().writeOpenApi(dir)writes the files. RouteData.preMiddlewarenow holds the group and router middleware.- Socket.IO:
AppConfig(socketIo: SocketIoConfig(enabled: true, ...))serves/socket.io/on the app port, before the router.Route.mount(prefix, handler)is the raw hook. Off by default. - No extra work per request when OpenAPI or Socket.IO is off.
- OpenAPI docs are automatic.
dart run build_runner buildwriteslib/openapi.g.dart. Pass it asOpenApiConfig(registry: openApiRegistry). Each route then gets its summary and description (from the///comment), tags,Class.methodoperation id, typed path params, request (a@Dtoclass) and answer schema (from the return type), plus401,404,422and500. - A middleware whose class name ends with
AuthMiddlewareaddsbearerAuthto the docs, with no config. - A
GETorDELETErequest class becomes query params in the docs. dox_coreexportsOpenApi,OpenApiRegistry,OpenApiOperation,OpenApiRouteBindingandResponseDocofdox_openapi.- The OpenAPI JSON and YAML are encoded once and kept, not on each request.
- New
EnvReaderandEnvExceptionfor the typed env class (@DoxEnv()). The real environment wins over.env, the same asEnv.get().Env.get()stays for dynamic keys. - OpenAPI:
/docsuses Scalar by default.OpenApiConfig(ui: DocsUi.swagger)gives Swagger UI. NewOpenApiConfigoptions:scalar: ScalarOptions(...)(theme, dark mode, download button, proxy) andpageTitle.
3.0.0-alpha.1
- Version 3 of Dox. All Dox packages now share one version.
- Needs Dart 3.6 or newer.
- See the release notes for all main changes.
- Faster: streamed bodies, all CPU cores, faster router.
uuid4 andmime2.
dox_http_native
3.0.0-alpha.5
- New:
NativeHttpServer.bind(port, address: ...)listens on one host, likeHttpServer.bind. AnInternetAddressor a host name. With no address it listens on all interfaces, as before.server.addressis the real address. - Fix:
close()never finished when nobody calledlisten()on the server. - Native ABI 3 (
dox_starttakes the host). Needs a new native library build. Until the next release, the build hook builds it with cargo. - New:
close()is graceful, likedart:io. The server stops taking connections at once, each open connection closes after its current answer, and the future completes when all are closed.close(force: true)closes every connection at once.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
DOX_HTTP_THREAD=sharedruns onedox-httpthread for all isolates. Default is still one thread per isolate, which measured faster.- Less work per request: request headers are read one name at a time, answers are not copied again in Rust, one wake per answer batch.
- Native ABI 2 (new header layout in the request record). Needs a new native library build.
3.0.0-alpha.2
- First release.
- Native HTTP/1.1 server: Rust (hyper, tokio) owns the sockets and parses HTTP. Handlers stay in Dart.
- Implements the
dart:ioHttpServer,HttpRequestandHttpResponseAPI, so code written fordart:ioworks unchanged. - One server per isolate on the same port (
SO_REUSEPORTon Linux and macOS). - 400 for bad requests, 431 for big headers, 413 for big bodies.
- The build hook downloads a ready-built library. No Rust needed.
dox_migration
3.0.0-alpha.5
DATABASE_URLsupport. When it is set, it wins overDB_CONNECTIONand the otherDB_*keys. Itssslmode(Postgres) orssl(MySQL) option turns TLS on.- A
DB_HOSTthat starts with/is a Postgres Unix socket folder, like/cloudsql/project:region:instanceon Cloud Run. - Migrations read real environment variables too. Before, a
.envfile hid them. Now a real env var wins over.env, the same asEnv.get()of dox_core. An empty value, ornull, counts as missing.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
sqlite33 (SQLite is bundled, no system library needed).
3.0.0-alpha.1
- Removed the
dox_migrationexecutable from pubspec (its script was removed before). Use thedoxCLI. - Added SQLite:
DB_CONNECTION=sqliteandDB_DATABASE=<file path>. - MySQL driver is now
mysql_dart(wasmysql1). The MySQL 8 default login (caching_sha2_password) works. migrate()and the other commands also take a pool (postgresPool, mysqlMySQLConnectionPool). Each file runs in one transaction on one connection.- Breaking: a passed mysql connection must be a
mysql_dartMySQLConnectionorMySQLConnectionPool(notmysql1). - Needs Dart 3.6 or newer.
3.0.0
- Support MySQL. Set
DB_CONNECTION=mysqlin.env(default ispostgres) - Run each statement of a
.sqlmigration one by one, inside a transaction - Rollback undoes only the last batch, newest first. Add
step,reset()andrefresh() - Stop at the first failed migration
- Fix
.sqlparsing: a-in the sql no longer cuts theupordownpart - Fix statement split:
;inside quotes, comments or$$bodies does not split
dox_mysql_native
3.0.0-alpha.5
- The hook comment says how to fill the sha256 list from a release:
dart run bin/native_hashes.dart <tag>. The list stays empty until the first release.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Breaking: this package no longer depends on
dox_orm.MysqlNativeDrivermoved intodox_orm, which now uses it as its default MySQL driver. This package keepsMysqlNativePool, with the same API.
3.0.0-alpha.2
- First release.
- Native MySQL and MariaDB driver: Rust (mysql_async, tokio) runs the pool and a prepared statement cache per connection. Dart gets typed rows.
MysqlNativeDriverplugs into the Dox ORM. The ORM gets the same types as with the Dart driver (mysql_dart).- Works with MySQL 8.4 (caching_sha2_password) and MariaDB 11.
- The build hook downloads a ready-built library. No Rust needed.
dox_openapi
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- A request body with a file field (
format: binary, also in a list) usesmultipart/form-datainstead ofapplication/json, so the/docspage can send files.RouteDoc(bodyMediaType:)sets it by hand. - Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
DoxRouteAdapterreadspreMiddlewareandbodyfrom a route when it has them.- A Dox catch-all param
{path*}and an optional param{id?}become{path}and{id}in the document. OpenApiOperation.formRequestis removed (form requests are gone).- New
OpenApiRegistry,OpenApiOperationandOpenApiRouteBinding: the docs thatdox_builderfinds in the code.OpenApiRegistry.find()matches them to a live route. RouteDocandApiDoc.route()takedeprecated.OpenApiServerbuilds and encodes the document once, on the first call, and keeps it. Make a newOpenApiServerafter you change theOpenApi.OpenApi.yamlEmitteris now a public field./docsuses Scalar (@scalar/api-reference1.75.1) by default.OpenApiServer(ui: DocsUi.swagger)gives Swagger UI.ScalarOptionssets the theme, dark mode, download button and proxy (off by default). The title and the config are escaped.- Swagger UI updated to 5.34.0.
3.0.0-alpha.1
- First release.
- Build an OpenAPI 3.1 document with
OpenApiandApiDoc. - Add undocumented Dox routes with
DoxRouteAdapter. - Output as JSON and YAML, write files, serve
/openapi.json,/openapi.yamland/docs.
dox_orm
3.0.0-alpha.5
DATABASE_URLsupport.ConnectionConfig.fromUrl()readspostgres://,postgresql://,mysql://,mariadb://,sqlite:andfile:urls: url-decoded user and password, host, port, database,sslmodeand other options (they go toextra).DatabaseConfighas a newurl. It isDATABASE_URLfrom the environment when not given. When it is set, it wins: it replaces the default connection. Passurl: ''to turn it off.- Postgres Unix sockets. A host that starts with
/is a socket folder, like/cloudsql/project:region:instanceon Cloud Run. Works on the native and the Dart driver. Use?host=/cloudsql/...in a url. - Breaking: the finders are typed. On a model,
get()andall()giveFuture<List<T>>,find()andgetFirst()giveFuture<T?>, andpaginate()givesFuture<Pagination<T>>(page.datais aList<T>).QueryBuilder.table()gives maps:get()isFuture<List<Map<String, dynamic>>>andgetFirst()isFuture<Map<String, dynamic>?>.QueryBuilder.table()has no type argument and no second argument any more. - Breaking:
groupBy()andrawQuery()rows are maps, so use them onQueryBuilder.table(). On a model,get()throws aStateErrorfor them.count()withgroupBy()still works on a model. - Breaking: the default foreign keys use the model name, like Laravel. A
Usermodel withtable: 'users'givesuser_id, notusers_id. The default pivot table of@ManyToManyalso uses the model names (artist_song). Keys you set yourself work as before. NewModel.foreignKeyNamegives the default key of a model. - Breaking:
save()inserts when the model is new and updates when the row is in the table (model.exists). Before, it updated when the primary key was set. So a new model with a key you set yourself, like a UUID, is now inserted. QueryBuilder.query()has a newconnectionparameter, to run a raw query on a named connection.- Fix:
withConnection()did not reachsave(),delete(),forceDelete()andrestore(). They used the default connection. Now they use the connection of the model. Models that a query returns keep the connection of the query, and relation queries use the connection of the parent model.Model.withConnection()returns the model, soBlog()..withConnection('other')works.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Postgres and MySQL/MariaDB now use the native drivers by default (
dox_postgres_nativeanddox_mysql_native). You do not change any config. If the native library does not load, the ORM uses the Dart driver and prints one warning line. SetDOX_DB_DRIVER=dart, orextra: {'native': false}on one connection, to use the Dart driver.driverFactorystill wins over all of this. - Breaking:
PostgresNativeDriverandMysqlNativeDrivermoved intodox_orm. Import them frompackage:dox_orm/dox_orm.dart. PostgresNativeDriver.querydoes one less async step per query.- Faster queries on all databases. Each connection keeps its prepared statements (LRU, 100 by default,
extra['preparedStatementCacheSize']). The same query now has the same sql text, so the statements are reused.find()no longer sendsLIMIT 1 OFFSET 0: LIMIT and OFFSET are only sent when set, and neverOFFSET 0. Less work per row when models are built. A find by id on SQLite went from 23 µs to 6 µs. - Less Dart work per query. A plain
find()builds its SQL once per driver, table and column, and reuses it. A model makes its maps and lists only when they are used. Rows become models without one moreawaitwhen there is nothing to preload. ORM work perWorld().find(id)went from 2.6 µs to 1.0 µs (no database, AOT). - New
ConnectionConfig.driverFactory: plug in your own driver class with one line. The default and the named connections use it.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
sqlite33. SQLite is now bundled by a build hook, so no systemlibsqlite3is needed.- Breaking:
dart compile exedoes not work with build hooks. Usedart build cli(ordox build). - SQLite: set
busy_timeoutbeforejournal_mode = WAL. Before, many isolates that opened the same file at start could fail with "database is locked". - New DTO rules
@Unique('users', column: 'email', ignoreParam: 'id')and@Exists('teams'). They run after all other checks. AListfield is checked with oneWHERE INquery. Soft-deleted rows count too.
3.0.0-alpha.1
- Renamed from
dox_query_buildertodox_orm. Changepackage:dox_query_builder/dox_query_builder.darttopackage:dox_orm/dox_orm.dart. The old package still works for now: it only re-exports this one. - Added SQLite (
Driver.sqlite, packagesqlite3).databaseis a file path or:memory:. Uses WAL,busy_timeoutand foreign keys. One connection per isolate. See the docs for limits. - MySQL driver is now
mysql_dart(wasmysql1). The MySQL 8 default login (caching_sha2_password) works. It uses a real connection pool (maxConnectionCount, default 10), prepared statements with bound values, and one pooled connection per transaction. - Breaking:
extra['characterSet'](amysql1type) is no longer read. Useextra['collation'](defaultutf8mb4_general_ci).getDatabaseConnection()for MySQL now returns aMySQLConnectionPool. - Breaking: MySQL
TIMEcolumns are now aString(was aDuration).BLOBcolumns areUint8List(was text). ConnectionConfig:user,passwordandportare optional (not used by SQLite).- Needs Dart 3.6 or newer.
- Added
whereNull,whereNotNull,orWhereNull,orWhereNotNull,whereNotIn,orWhereIn,orWhereNotInandselectRaw. - Added
QueryBuilder.transaction(). Postgres now uses a real connection pool (maxConnectionCount) and no longer runs each query in its own transaction. - Added
boolean()schema column (PostgresBOOLEAN, MySQLTINYINT(1), read asbool). - Table and column names are now quoted (
"name"on Postgres,`name`on MySQL). On Postgres, quoted names are case sensitive. UseselectRaw/whereRawfor raw SQL. count()ignoreslimit,offsetandorderBy. WithgroupByit now returns the number of groups (before: the size of the first group).save()can set a field to null on update.insert()works with any primary key type (uuid strings too).model.delete()andmodel.forceDelete()only delete that record. Before, they had no where condition.forceDelete()also deletes soft deleted rows.withTrash(false)on a model without soft deletes no longer adds adeleted_atfilter.- hasOne, hasMany and manyToMany work with a custom
localKey. insertMultiple()uses keys from all rows. Missing keys use the column default.- MySQL: only JSON columns are decoded (arrays too). MariaDB keeps decoding JSON-like text, because it stores JSON as text.
- Schema:
unique()on a column that is already unique is skipped. Default values are escaped.
dox_postgres_native
3.0.0-alpha.5
- The hook comment says how to fill the sha256 list from a release:
dart run bin/native_hashes.dart <tag>. The list stays empty until the first release. - A
hostthat starts with/is a Unix socket folder (eg. Cloud SQL/cloudsql/project:region:instance). A test checks it.
3.0.0-alpha.4
- Less work per request. Rust copies a batch of requests once and keeps slices of it, instead of one copy of the SQL and of each parameter. A batch of plain queries uses one timeout timer, not one per query. Dart keeps waiting requests in a list, not a map.
3.0.0-alpha.3
- Column names and types are decoded once per result shape. The next result with the same columns reuses them.
- Breaking: this package no longer depends on
dox_orm.PostgresNativeDrivermoved intodox_orm, which now uses it as its default Postgres driver. This package keepsPgNativePool. - Fix: a request never got an answer in two cases. A value that Dart can
not decode (eg. a timestamp out of the
DateTimerange) lost every other result of the same batch. A request sent to a transaction after its end (eg. a second rollback) was dropped. Both now fail with a clear error. - A request that gets no answer in 5 minutes fails with a timeout error
(like
queryTimeoutof thepostgrespackage). Connect timeout is 15 s. A transaction that Dart does not end in 5 minutes is rolled back, so its connection goes back to the pool. tool/stress.dart: a stress test that finds requests that never finish.- Faster queries. Plain queries now share connections: tokio-postgres
sends the queries of one connection together (pipelining). One tokio task
runs each batch from Dart, not one task per query. The SQL bytes are
cached, and binding named parameters builds no extra
Set.
3.0.0-alpha.2
- First release.
- Native Postgres driver: Rust (tokio-postgres, deadpool-postgres) owns the connections. Your code stays in Dart.
PostgresNativeDriverfor the Dox ORM. Same types and exceptions as thepostgrespackage.PgNativePool: queries, transactions, one pool for many isolates.
dox_query_builder
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
3.0.0-alpha.1
- This package is renamed to
dox_orm. It now only re-exportspackage:dox_orm/dox_orm.dart. - Please depend on
dox_ormand change your imports. See the README.
dox_socketio
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
3.0.0-alpha.1
- Uses
ioredis2. RedisAdapterlistens withPSUBSCRIBE, so it also gets the room channels that the Node.js redis adapter uses for one room.onRedisMessagenow takes(pattern, channel, message).- First version. Socket.IO v4 server (Engine.IO v4, Socket.IO protocol v5).
- Polling and websocket transports, upgrade, heartbeat, CORS.
- Namespaces, middleware, rooms, broadcast, acks, binary.
- In-memory adapter and Redis adapter.
dox_storage
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
3.0.0-alpha.1
- Initial version.
DriveManagerandDiskwith a FlyDrive-like API.- Drivers:
LocalDriver,S3Driver(AWS S3, R2, MinIO, Spaces, GCS interop),MemoryDriver. - AWS Signature V4 signing, presigned download and upload URLs, multipart upload.
DriveManager.fake()for tests.
dox_validation
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- A JSON body that is not an object now says
The request body must be a JSON object.(key_root). Change it with the message key_root.object. - Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
- New: DTOs. A class with
@Dto()and rule annotations (@Length,@Email,@Min,@Regex,@MaxSize, ...).dox_builderwrites aconst DtoSchema<T>with the checks, a converter and the JSON Schema. See the Validation guide. - New:
DtoSchema<T>withvalidateMap,safeValidateMap,fromMap,toMapandtoJsonSchema. It is also aSchema<T>. - New:
Maybe<T>knows a missing key fromnull.DtoErrorsfor checks across fields invalidate(). - New:
FileTypesfinds the real type of a file from its first bytes.@Image()andv.file().image()do not allowsvg. - New:
MessageRequest.locale,ParseState.params. A message set on a rule is used as it is; the resolver only fills its placeholders. Rulehas aconstconstructor and afinalmessage, so a rule class works as an annotation.AsyncRule.failedItems()checks a list in one call.FileInputhaslengthandhead(the first bytes).Schemahas aconstconstructor. The fluent schemas extendBaseSchema.- Text length messages say "characters".
- Breaking: removed
v.fromRules(),v.registerRule(),RuleRegistry,RuleDefinition,CallbackRuleand all rule strings. Use a DTO, or aRule<T>class.
3.0.0-alpha.1
- First release of
dox_validation. - Fluent schema builder: string, int, num, bool, date, enum, literal, list, object, map, union, any, file.
optional,nullable,nullish,defaultTo,transform,refine,superRefine, async refinements.- Coercion with
v.coercefor query strings and form data. parse,safeParse,parseAsync,safeParseAsyncwith issue paths.- Standard Schema interface (
StandardSchema). - JSON Schema (draft 2020-12 / OpenAPI 3.1) export with
toJsonSchema(). - Custom
Ruleclasses and a globalMessageResolver. - Laravel style string rules with
v.fromRules().
dox_websocket
3.0.0-alpha.5
- Version bump only, to match the other packages.
3.0.0-alpha.4
- Version bump only, to match the other packages.
3.0.0-alpha.3
- Version bump only, to match the other packages.
3.0.0-alpha.2
- Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
WebsocketAdapterInterface.emitnow has avoidreturn type.
3.0.0-alpha.1
- Version 3 of Dox. All Dox packages now share one version.
- Needs Dart 3.6 or newer.
- See the release notes for all main changes.
uuid4 andioredis2.