Skip to content

Commit 96b8bef

Browse files
committed
some interface
0 parents  commit 96b8bef

16 files changed

+140
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
.dart_tool/
3+
.vscode/
4+
5+
pubspec.lock

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0
2+
3+
- Initial version.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A sample command-line application with an entrypoint in `bin/`, library code
2+
in `lib/`, and example unit test in `test/`.

analysis_options.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options

bin/dart_gdbc.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import 'package:dart_gdbc/dart_gdbc.dart' as dart_gdbc;
2+
3+
void main(List<String> arguments) {
4+
// print('Hello world: ${dart_gdbc.calculate()}!');
5+
}

lib/dart_gdbc.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
library dart_gdbc;
2+
3+
part 'src/driver.dart';
4+
part 'src/connection.dart';
5+
part 'src/statement.dart';
6+
part 'src/result_set.dart';
7+
part 'src/result_set_meta_data.dart';
8+
part 'src/parameter_meta_data.dart';
9+
10+
part 'src/prepared_statement.dart';
11+
12+
part 'src/data_source.dart';

lib/src/connection.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
part of dart_gdbc;
2+
3+
abstract class Connection {
4+
Future<Statement> createStatement();
5+
6+
Future<PreparedStatement> prepareStatement(String gql);
7+
8+
Future<PreparedStatement> prepareStatementWithParameters(
9+
String gql, List<ParameterMetaData> parameters);
10+
11+
Future<ResultSet> executeQuery(String gql);
12+
13+
Future<int> executeUpdate(String gql);
14+
15+
Future<bool> getAutoCommit();
16+
17+
Future<void> setAutoCommit(bool autoCommit);
18+
19+
Future<void> commit();
20+
21+
Future<void> rollback();
22+
23+
Future<void> close();
24+
25+
Future<bool> isClosed();
26+
27+
Future<ResultSetMetaData> getMetaData();
28+
}

lib/src/data_source.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
part of dart_gdbc;
2+
3+
abstract class DataSource {
4+
Future<Connection> getConnection({String username, String password});
5+
}

lib/src/driver.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
part of dart_gdbc;
2+
3+
abstract class Driver {
4+
Connection connect(String url, {Map<String, String> properties});
5+
6+
bool acceptsURL(String url);
7+
}

lib/src/parameter_meta_data.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
part of dart_gdbc;
2+
3+
abstract class ParameterMetaData {}

0 commit comments

Comments
 (0)