<commit_before># PostgreSQL database driver for Dart

This is alpha level software, expect things to break, especially with the
number of breaking changes happening in Dart's libraries at the moment.

## Basic usage

### Obtaining a connection

```dart
connect('username', 'database', 'password', host: 'localhost', port: 5432).then((conn) {
	// ...
});
```

### Querying

```dart
conn.query('select color from crayons').toList().then((rows) {
	for (var row in rows) {
		print(row.color); // Refer to columns by name,
		print(row[0]);    // Or by column index.
	}
});
```

### Executing

```dart
conn.execute("update crayons set color = 'pink'").then((result) {
	print(result.rowsAffected);
});
```

### Closing the connection

You must remember to call Connection.close() when you're done. This wont be
done automatically for you.

### Query queueing

Queries are queued and executed in the order in which they were queued.

So you can write code like this:

```dart
conn.execute("update crayons set color = 'pink'");
conn.query("select color from crayons").toList().then((rows) {
	rows.forEach((row) => print(row.color); 
});
```

### Query streaming

Connection.query() returns a Stream of results. You can use each row as soon as
it is received, or you can wait till they all arrive by calling Stream.toList().


## Testing

To run the unit tests you will need to create a database, and add the database
name, username and password to 'postgresql_test.dart'.

### Creating a database for testing

Change to the postgres user and run the administration commands.
```bash
sudo su postgres
createuser --pwprompt testdb
  Enter password for new role: password
  Enter it again: password
  Shall the new role be a superuser? (y/n) n
  Shall the new role be allowed to create databases? (y/n) n
  Shall the new role be allowed to create more new roles? (y/n) n
createdb --owner testdb testdb
exit
```

Check that it worked by logging in.
```bash
psql -h localhost -U testdb3 -W
```

Enter "\q" to quit from the psql console.

## License

BSD

## Links

http://www.postgresql.org/docs/9.2/static/index.html
http://www.dartlang.org/<commit_msg>Fix readme<commit_after># PostgreSQL database driver for Dart

This is alpha level software, expect things to break, especially with the
number of breaking changes happening in Dart's libraries at the moment.

## Basic usage

### Obtaining a connection

```dart
connect('username', 'database', 'password', host: 'localhost', port: 5432).then((conn) {
	// ...
});
```

### Querying

```dart
conn.query('select color from crayons').toList().then((rows) {
	for (var row in rows) {
		print(row.color); // Refer to columns by name,
		print(row[0]);    // Or by column index.
	}
});
```

### Executing

```dart
conn.execute("update crayons set color = 'pink'").then((result) {
	print(result.rowsAffected);
});
```

### Closing the connection

You must remember to call Connection.close() when you're done. This wont be
done automatically for you.

### Query queueing

Queries are queued and executed in the order in which they were queued.

So you can write code like this:

```dart
conn.execute("update crayons set color = 'pink'");
conn.query("select color from crayons").toList().then((rows) {
	rows.forEach((row) => print(row.color); 
});
```

### Query streaming

Connection.query() returns a Stream of results. You can use each row as soon as
it is received, or you can wait till they all arrive by calling Stream.toList().


## Testing

To run the unit tests you will need to create a database, and add the database
name, username and password to 'postgresql_test.dart'.

### Creating a database for testing

Change to the postgres user and run the administration commands.
```bash
sudo su postgres
createuser --pwprompt testdb
  Enter password for new role: password
  Enter it again: password
  Shall the new role be a superuser? (y/n) n
  Shall the new role be allowed to create databases? (y/n) n
  Shall the new role be allowed to create more new roles? (y/n) n
createdb --owner testdb testdb
exit
```

Check that it worked by logging in.
```bash
psql -h localhost -U testdb -W
```

Enter "\q" to quit from the psql console.

## License

BSD

## Links

http://www.postgresql.org/docs/9.2/static/index.html
http://www.dartlang.org/
{'fraction_non_alphanumeric': 0.12114125350795135, 'fraction_numerical': 0.0035079513564078577, 'mean_word_length': 4.055555555555555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6376265', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1287, 'n_words': 550}