{"id":13395688,"url":"https://github.com/jamesots/sqljocky","last_synced_at":"2025-10-23T08:14:42.528Z","repository":{"id":56840386,"uuid":"68229980","full_name":"jamesots/sqljocky","owner":"jamesots","description":"MySQL Connector for Dart","archived":false,"fork":true,"pushed_at":"2017-07-03T01:42:01.000Z","size":1662,"stargazers_count":20,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-31T18:15:43.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dart-drivers/mysql","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesots.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-14T17:56:19.000Z","updated_at":"2023-07-09T15:16:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jamesots/sqljocky","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesots%2Fsqljocky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesots%2Fsqljocky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesots%2Fsqljocky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesots%2Fsqljocky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesots","download_url":"https://codeload.github.com/jamesots/sqljocky/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243493109,"owners_count":20299597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T18:00:28.112Z","updated_at":"2025-10-23T08:14:37.169Z","avatar_url":"https://github.com/jamesots.png","language":"Dart","readme":"SQLJocky\n========\n\nThis is a MySQL connector for the Dart programming language. It isn't finished, but should\nwork for most normal use. The API is getting reasonably close to where I want it to\nbe now, so hopefully there shouldn't be too many breaking changes in the future.\n\nIt will only work in the command-line VM, not in a browser.\n\nNews\n----\n\nThe changelog has now been moved to CHANGELOG.md\n\nUsage\n-----\n\nCreate a connection pool:\n\n```dart\nvar pool = new ConnectionPool(\n    host: 'localhost', port: 3306,\n    user: 'bob', password: 'wibble',\n    db: 'stuff', max: 5);\n```\n\nExecute a query:\n\n```dart\nvar results = await pool.query('select name, email from users');\n```\n\nUse the results: (*Note: forEach is asynchronous.*)\n\n```dart\nresults.forEach((row) {\n  print('Name: ${row[0]}, email: ${row[1]}');\n});\n```\n\nOr access the fields by name:\n\n```dart\nresults.forEach((row) {\n  print('Name: ${row.name}, email: ${row.email}');\n});\n```\n\nPrepare a query:\n\n```dart\nvar query = await pool.prepare(\n  'insert into users (name, email, age) values (?, ?, ?)');\n```\n\nExecute the query:\n\n```dart\nvar result = await query.execute(['Bob', 'bob@bob.com', 25]);\n```\n\nAn insert query's results will be empty, but will have an id if there was an auto-increment column in the table:\n\n```dart\nprint(\"New user's id: ${result.insertId}\");\n```\n\nExecute a query with multiple sets of parameters:\n\n```dart\nvar results = await query.executeMulti([['Bob', 'bob@bob.com', 25],\n    ['Bill', 'bill@bill.com', 26],\n    ['Joe', 'joe@joe.com', 37]]);\n```\n\nUse the list of results:\n\n```dart\nfor (result in results) {\n  print(\"New user's id: ${result.insertId}\");\n}\n```\n\nUse a transaction:\n\n```dart\nvar trans = await pool.startTransaction();\nvar result = await trans.query('...');\nawait trans.commit();\n```\n\nDevelopment\n-----------\n\nTo run the examples and tests, you'll need to create a 'connection.options' file by\ncopying 'connection.options.example' and modifying the settings.\n\nLicence\n-------\n\nIt is released under the GPL, because it uses a modified part of mysql's include/mysql_com.h in constants.dart,\nwhich is licensed under the GPL. I would prefer to release it under the BSD Licence, but there you go.\n\nThe Name\n--------\n\nIt is named after [Jocky Wilson](http://en.wikipedia.org/wiki/Jocky_Wilson), the late, great\ndarts player. (Hence the lack of an 'e' in Jocky.)\n\nThings to do\n------------\n\n* Compression\n* COM_SEND_LONG_DATA\n* CLIENT_MULTI_STATEMENTS and CLIENT_MULTI_RESULTS for stored procedures\n* More connection pool management (close after timeout, change pool size...)\n* Better handling of various data types, especially BLOBs, which behave differently when using straight queries and prepared queries.\n* Implement the rest of mysql's commands\n* Handle character sets properly? Currently defaults to UTF8 for the connection character set. Is it\nnecessary to support anything else?\n* Improve performance where possible\n* Geometry type\n* Decimal type should probably use a bigdecimal type of some sort\n* MySQL 4 types (old decimal, anything else?)\n* Test against multiple mysql versions\n","funding_links":[],"categories":["Database","数据库","Libraries"],"sub_categories":["Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesots%2Fsqljocky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesots%2Fsqljocky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesots%2Fsqljocky/lists"}