-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix insertGetId for mysql and add more tests
- Loading branch information
Isaque Neves
committed
Dec 28, 2023
1 parent
852f17e
commit 9e3a25d
Showing
9 changed files
with
187 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:eloquent/eloquent.dart'; | ||
|
||
void main(List<String> args) async { | ||
for (var i = 0; i < 1000000; i++) { | ||
final stopwatch = new Stopwatch()..start(); | ||
final db = await getConn(); | ||
final res = await db.table('test_table').select(['name']).limit(1).get(); | ||
db.disconnect(); | ||
print('executed in ${stopwatch.elapsed.inMilliseconds}ms'); | ||
print('res $res'); | ||
//await Future.delayed(Duration(milliseconds: 1000)); | ||
} | ||
|
||
exit(0); | ||
} | ||
|
||
Future<Connection> getConn() async { | ||
final manager = Manager(); | ||
manager.addConnection({ | ||
'driver': 'pgsql', | ||
'driver_implementation': 'postgres_v3', | ||
'host': 'localhost', | ||
'port': '5435', | ||
'database': 'siamweb', | ||
'username': 'dart', | ||
'password': 'dart', | ||
'charset': 'win1252', | ||
'prefix': '', | ||
'schema': ['public'], | ||
//'sslmode' : 'require', | ||
// 'pool': true, | ||
// 'poolsize': 50, | ||
}); | ||
manager.setAsGlobal(); | ||
final db = await manager.connection(); | ||
return db; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters