Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions frameworks/Dart/angel3/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Angel3 Framework Benchmarking Test

This is the Angel3 framework portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
This is the Angel3 framework portion of a [benchmarking test suite](../) comparing a variety of web development platforms.

## Description

All the tests are implemented using the [Angel3 Framework](https://angel3-framework.web.app) with ORM for Postgresql database enabled. The directory layout follows the standard ORM boilerplate template.
All the tests are implemented using the [Angel3 Framework](https://angel3-framework.web.app) with ORM for Postgresql and MySQL database on Dart 3.6. The directory layout follows the standard ORM boilerplate template.

### Test Type Implementation Source Code

Expand All @@ -28,24 +28,24 @@ The tests were run with:

### JSON

http://localhost:8080/json
<http://localhost:8080/json>

### PLAINTEXT

http://localhost:8080/plaintext
<http://localhost:8080/plaintext>

### DB

http://localhost:8080/db
<http://localhost:8080/db>

### QUERY

http://localhost:8080/query?queries=
<http://localhost:8080/query?queries=>

### UPDATE

http://localhost:8080/updates?queries=
<http://localhost:8080/updates?queries=>

### FORTUNES

http://localhost:8080/fortunes
<http://localhost:8080/fortunes>
2 changes: 1 addition & 1 deletion frameworks/Dart/angel3/angel3-mysql.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dart:2.19.6
FROM dart:3.6.1

COPY ./orm-mysql/config /app/config
COPY ./orm-mysql/lib /app/lib
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Dart/angel3/angel3.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dart:2.19.6
FROM dart:3.6.1

COPY ./orm/config /app/config
COPY ./orm/lib /app/lib
Expand Down
3 changes: 3 additions & 0 deletions frameworks/Dart/angel3/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
"versus": "None"
},
"mysql": {
"json_url": "/json",
"db_url": "/db",
"plaintext_url": "/plaintext",
"query_url": "/query?queries=",
"fortune_url": "/fortunes",
"update_url": "/updates?queries=",
"port": 8080,
"approach": "Realistic",
"classification": "Fullstack",
Expand Down
1 change: 0 additions & 1 deletion frameworks/Dart/angel3/orm-mysql/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
host: 127.0.0.1
port: 8080
mysql:
#host: localhost
host: tfb-database
port: 3306
database_name: hello_world
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// Your very own web application!
import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:file/local.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// Configuration for this Angel instance.
import 'package:angel3_configuration/angel3_configuration.dart';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_jael/angel3_jael.dart';
Expand Down
36 changes: 0 additions & 36 deletions frameworks/Dart/angel3/orm-mysql/lib/src/config/plugins/orm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,9 @@ import 'dart:io';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_orm/angel3_orm.dart';
import 'package:angel3_orm_mysql/angel3_orm_mysql.dart';
import 'package:mysql1/mysql1.dart';
import 'package:mysql_client/mysql_client.dart';

// For MariaDb
Future<void> configureServer2(Angel app) async {
try {
var connection = await connectToMariaDb(app.configuration);
var executor = MariaDbExecutor(connection, logger: app.logger);

app
..container.registerSingleton<QueryExecutor>(executor)
..shutdownHooks.add((_) => connection.close());
} catch (e) {
app.logger.severe("Failed to connect to MariaDB. ORM disabled.", e);
}
}

// MariaDB connection
Future<MySqlConnection> connectToMariaDb(Map configuration) async {
var mariaDbConfig = configuration['mysql'] as Map? ?? {};
var settings = ConnectionSettings(
host: mariaDbConfig['host'] as String? ?? 'localhost',
port: mariaDbConfig['port'] as int? ?? 3306,
db: mariaDbConfig['database_name'] as String? ??
Platform.environment['USER'] ??
Platform.environment['USERNAME'] ??
'',
user: mariaDbConfig['username'] as String?,
password: mariaDbConfig['password'] as String?,
timeout: Duration(
seconds: mariaDbConfig['timeout_in_seconds'] as int? ?? 30000),
useSSL: mariaDbConfig['use_ssl'] as bool? ?? false);

var connection = await MySqlConnection.connect(settings);
return connection;
}

// For Mysql

Future<void> configureServer(Angel app) async {
try {
var connection = await connectToMysql(app.configuration);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// Custom plugins go here.
import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart';
import 'orm.dart' as orm;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:angel3_migration/angel3_migration.dart';
//import 'package:angel3_model/angel3_model.dart';
import 'package:angel3_serialize/angel3_serialize.dart';
import 'package:angel3_orm/angel3_orm.dart';
import 'package:optional/optional.dart';
Expand Down
57 changes: 44 additions & 13 deletions frameworks/Dart/angel3/orm-mysql/lib/src/models/fortune.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading