diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 760e28e..3a97c99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build on: [push,pull_request] jobs: - build: + build: runs-on: ubuntu-latest strategy: fail-fast: false @@ -20,15 +20,15 @@ jobs: - name: Set up Smalltalk CI uses: hpi-swa/setup-smalltalkCI@v1 with: - smalltalk-version: ${{ matrix.smalltalk }} + smalltalk-image: ${{ matrix.smalltalk }} - name: Load Image and Run Tests run: smalltalkci -s ${{ matrix.smalltalk }} - timeout-minutes: 15 env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} RDBMS: ${{ matrix.rdbms }} - - run: echo "::set-env name=SCI_COVERAGE_FILE_LOCATION::${HOME}/.smalltalkCI/_builds/coveralls_results.json" + timeout-minutes: 15 - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.0.6 + uses: codecov/codecov-action@v1 with: + name: ${{matrix.os}}-${{matrix.smalltalk}}-${{ matrix.rdbms }} token: ${{ secrets.CODECOV_TOKEN }} - file: ${{ env.SCI_COVERAGE_FILE_LOCATION }} diff --git a/.smalltalk.ston b/.smalltalk.ston index 6129be9..e5fd22d 100644 --- a/.smalltalk.ston +++ b/.smalltalk.ston @@ -8,11 +8,9 @@ SmalltalkCISpec { } ], #testing : { - #coverage : { + #coverage : { #packages : [ 'MySQL*' ], - #service: #codecov, - #auto_upload: false - } + #format: #lcov } } } diff --git a/BaselineOfMySQL/BaselineOfMySQL.class.st b/BaselineOfMySQL/BaselineOfMySQL.class.st index 32ea836..03488a7 100644 --- a/BaselineOfMySQL/BaselineOfMySQL.class.st +++ b/BaselineOfMySQL/BaselineOfMySQL.class.st @@ -20,7 +20,7 @@ BaselineOfMySQL >> baseline: spec [ group: 'CI' with: #('Tests' 'Glorp-Tests'); group: 'Development' with: #('Tests' 'glorp'); group: 'default' with: #('all'); - group: 'all' with: #('core' 'Tests') + group: 'all' with: #('Core' 'Tests') ] ] @@ -53,7 +53,7 @@ BaselineOfMySQL >> setUpPackages: spec [ spec package: 'MySQL-Core' with: [ spec requires: #('NeoJSON-Core' 'ZTimestamp') ]; - group: 'core' with: 'MySQL-Core'. + group: 'Core' with: 'MySQL-Core'. spec package: 'MySQL-Glorp' with: [ spec requires: #('MySQL-Core' 'Glorp-Deployment') ]; diff --git a/MySQL-Core-Tests-Integration/MysqlCommandsTest.class.st b/MySQL-Core-Tests-Integration/MySQLCommandsTest.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlCommandsTest.class.st rename to MySQL-Core-Tests-Integration/MySQLCommandsTest.class.st diff --git a/MySQL-Core-Tests-Integration/MysqlDriverTest.class.st b/MySQL-Core-Tests-Integration/MySQLDriverTest.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlDriverTest.class.st rename to MySQL-Core-Tests-Integration/MySQLDriverTest.class.st diff --git a/MySQL-Core-Tests-Integration/MysqlMultiStatementTest.class.st b/MySQL-Core-Tests-Integration/MySQLMultiStatementTest.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlMultiStatementTest.class.st rename to MySQL-Core-Tests-Integration/MySQLMultiStatementTest.class.st diff --git a/MySQL-Core-Tests-Integration/MysqlQueryStatusTest.class.st b/MySQL-Core-Tests-Integration/MySQLQueryStatusTest.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlQueryStatusTest.class.st rename to MySQL-Core-Tests-Integration/MySQLQueryStatusTest.class.st diff --git a/MySQL-Core-Tests-Integration/MySQLStatementReadTest.class.st b/MySQL-Core-Tests-Integration/MySQLStatementReadTest.class.st index ca54e10..99f83cd 100644 --- a/MySQL-Core-Tests-Integration/MySQLStatementReadTest.class.st +++ b/MySQL-Core-Tests-Integration/MySQLStatementReadTest.class.st @@ -293,5 +293,5 @@ MySQLStatementReadTest >> testReadTimeTypesNull [ self assert: (resp rows third atIndex: 2) isNil. self assert: (resp rows third atIndex: 3) isNil. self assert: (resp rows third atIndex: 4) isNil. - self assert: (resp rows third atIndex: 5) isNotNil ] + self assert: (resp rows fourth atIndex: 5) isNotNil ] ] diff --git a/MySQL-Core-Tests-Integration/MysqlTestCase.class.st b/MySQL-Core-Tests-Integration/MySQLTestCase.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlTestCase.class.st rename to MySQL-Core-Tests-Integration/MySQLTestCase.class.st diff --git a/MySQL-Core-Tests-Integration/MysqlTestFixture.class.st b/MySQL-Core-Tests-Integration/MySQLTestFixture.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlTestFixture.class.st rename to MySQL-Core-Tests-Integration/MySQLTestFixture.class.st diff --git a/MySQL-Core-Tests-Integration/MysqlTestResource.class.st b/MySQL-Core-Tests-Integration/MySQLTestResource.class.st similarity index 100% rename from MySQL-Core-Tests-Integration/MysqlTestResource.class.st rename to MySQL-Core-Tests-Integration/MySQLTestResource.class.st diff --git a/MySQL-Core-Tests/MysqlHelperTest.class.st b/MySQL-Core-Tests/MySQLHelperTest.class.st similarity index 100% rename from MySQL-Core-Tests/MysqlHelperTest.class.st rename to MySQL-Core-Tests/MySQLHelperTest.class.st diff --git a/MySQL-Core/Mysql323Scramble.class.st b/MySQL-Core/MySQL323Scramble.class.st similarity index 100% rename from MySQL-Core/Mysql323Scramble.class.st rename to MySQL-Core/MySQL323Scramble.class.st diff --git a/MySQL-Core/MySQLBinaryRowData.class.st b/MySQL-Core/MySQLBinaryRowData.class.st index f076bb1..a407d2f 100644 --- a/MySQL-Core/MySQLBinaryRowData.class.st +++ b/MySQL-Core/MySQLBinaryRowData.class.st @@ -25,6 +25,11 @@ MySQLBinaryRowData >> columnDescriptors: fieldList [ ] +{ #category : #enumerating } +MySQLBinaryRowData >> do: aBlock [ + ^columnValues do: aBlock +] + { #category : #testing } MySQLBinaryRowData >> isColumnNullAt: index [ | byteIndex bitsToShift bitMask | diff --git a/MySQL-Core/MysqlBindError.class.st b/MySQL-Core/MySQLBindError.class.st similarity index 100% rename from MySQL-Core/MysqlBindError.class.st rename to MySQL-Core/MySQLBindError.class.st diff --git a/MySQL-Core/MysqlClientAuth.class.st b/MySQL-Core/MySQLClientAuth.class.st similarity index 100% rename from MySQL-Core/MysqlClientAuth.class.st rename to MySQL-Core/MySQLClientAuth.class.st diff --git a/MySQL-Core/MysqlCommand.class.st b/MySQL-Core/MySQLCommand.class.st similarity index 100% rename from MySQL-Core/MysqlCommand.class.st rename to MySQL-Core/MySQLCommand.class.st diff --git a/MySQL-Core/MysqlComplexResult.class.st b/MySQL-Core/MySQLComplexResult.class.st similarity index 100% rename from MySQL-Core/MysqlComplexResult.class.st rename to MySQL-Core/MySQLComplexResult.class.st diff --git a/MySQL-Core/MysqlDriver.class.st b/MySQL-Core/MySQLDriver.class.st similarity index 100% rename from MySQL-Core/MysqlDriver.class.st rename to MySQL-Core/MySQLDriver.class.st diff --git a/MySQL-Core/MysqlDriverError.class.st b/MySQL-Core/MySQLDriverError.class.st similarity index 100% rename from MySQL-Core/MysqlDriverError.class.st rename to MySQL-Core/MySQLDriverError.class.st diff --git a/MySQL-Core/MysqlDriverSpec.class.st b/MySQL-Core/MySQLDriverSpec.class.st similarity index 97% rename from MySQL-Core/MysqlDriverSpec.class.st rename to MySQL-Core/MySQLDriverSpec.class.st index 432812d..08baded 100644 --- a/MySQL-Core/MysqlDriverSpec.class.st +++ b/MySQL-Core/MySQLDriverSpec.class.st @@ -57,7 +57,7 @@ MySQLDriverSpec >> password: userPassword [ { #category : #accessing } MySQLDriverSpec >> port [ - ^ port + ^ port ifNil: [ port := 3306 ] ] { #category : #accessing } diff --git a/MySQL-Core/MysqlEof.class.st b/MySQL-Core/MySQLEof.class.st similarity index 100% rename from MySQL-Core/MysqlEof.class.st rename to MySQL-Core/MySQLEof.class.st diff --git a/MySQL-Core/MysqlError.class.st b/MySQL-Core/MySQLError.class.st similarity index 100% rename from MySQL-Core/MysqlError.class.st rename to MySQL-Core/MySQLError.class.st diff --git a/MySQL-Core/MysqlField.class.st b/MySQL-Core/MySQLField.class.st similarity index 93% rename from MySQL-Core/MysqlField.class.st rename to MySQL-Core/MySQLField.class.st index 69522e3..5f791b3 100644 --- a/MySQL-Core/MysqlField.class.st +++ b/MySQL-Core/MySQLField.class.st @@ -138,6 +138,17 @@ MySQLField >> parse [ ] +{ #category : #accessing } +MySQLField >> printOn: aStream [ + super printOn: aStream. + aStream + nextPutAll: ' ('; + nextPutAll: table; + nextPut: $.; + nextPutAll: self name; + nextPutAll: ')' +] + { #category : #accessing } MySQLField >> table [ ^ table diff --git a/MySQL-Core/MysqlHandshake.class.st b/MySQL-Core/MySQLHandshake.class.st similarity index 100% rename from MySQL-Core/MysqlHandshake.class.st rename to MySQL-Core/MySQLHandshake.class.st diff --git a/MySQL-Core/MysqlHelper.class.st b/MySQL-Core/MySQLHelper.class.st similarity index 100% rename from MySQL-Core/MysqlHelper.class.st rename to MySQL-Core/MySQLHelper.class.st diff --git a/MySQL-Core/MysqlInvalidPacketError.class.st b/MySQL-Core/MySQLInvalidPacketError.class.st similarity index 100% rename from MySQL-Core/MysqlInvalidPacketError.class.st rename to MySQL-Core/MySQLInvalidPacketError.class.st diff --git a/MySQL-Core/MysqlInvalidRowAccess.class.st b/MySQL-Core/MySQLInvalidRowAccess.class.st similarity index 100% rename from MySQL-Core/MysqlInvalidRowAccess.class.st rename to MySQL-Core/MySQLInvalidRowAccess.class.st diff --git a/MySQL-Core/MysqlNameLookupFailure.class.st b/MySQL-Core/MySQLNameLookupFailure.class.st similarity index 100% rename from MySQL-Core/MysqlNameLookupFailure.class.st rename to MySQL-Core/MySQLNameLookupFailure.class.st diff --git a/MySQL-Core/MySQLNetworkSession.class.st b/MySQL-Core/MySQLNetworkSession.class.st index 2e8b5a9..0bea0bd 100644 --- a/MySQL-Core/MySQLNetworkSession.class.st +++ b/MySQL-Core/MySQLNetworkSession.class.st @@ -95,6 +95,16 @@ MySQLNetworkSession >> stream: aStream [ ] +{ #category : #accessing } +MySQLNetworkSession >> timeout [ + ^theStream timeout +] + +{ #category : #accessing } +MySQLNetworkSession >> timeout: seconds [ + theStream timeout: seconds +] + { #category : #accessing } MySQLNetworkSession >> toHost: host andPort: port [ | aStream | diff --git a/MySQL-Core/MysqlNoConnectionError.class.st b/MySQL-Core/MySQLNoConnectionError.class.st similarity index 100% rename from MySQL-Core/MysqlNoConnectionError.class.st rename to MySQL-Core/MySQLNoConnectionError.class.st diff --git a/MySQL-Core/MysqlOkay.class.st b/MySQL-Core/MySQLOkay.class.st similarity index 100% rename from MySQL-Core/MysqlOkay.class.st rename to MySQL-Core/MySQLOkay.class.st diff --git a/MySQL-Core/MysqlPacket.class.st b/MySQL-Core/MySQLPacket.class.st similarity index 100% rename from MySQL-Core/MysqlPacket.class.st rename to MySQL-Core/MySQLPacket.class.st diff --git a/MySQL-Core/MysqlPrepareOkay.class.st b/MySQL-Core/MySQLPrepareOkay.class.st similarity index 100% rename from MySQL-Core/MysqlPrepareOkay.class.st rename to MySQL-Core/MySQLPrepareOkay.class.st diff --git a/MySQL-Core/MysqlQueryRowData.class.st b/MySQL-Core/MySQLQueryRowData.class.st similarity index 80% rename from MySQL-Core/MysqlQueryRowData.class.st rename to MySQL-Core/MySQLQueryRowData.class.st index 88322b2..1c10b47 100644 --- a/MySQL-Core/MysqlQueryRowData.class.st +++ b/MySQL-Core/MySQLQueryRowData.class.st @@ -11,9 +11,25 @@ Class { #category : #'MySQL-Core-Packet-RowData' } +{ #category : #accessing } +MySQLQueryRowData >> asDictionary [ + | pairs | + pairs := OrderedCollection new: fields size. + fields doWithIndex: [ :f :i | pairs add: (f name -> (self atIndex: i)) ]. + ^pairs asDictionary +] + { #category : #accessing } MySQLQueryRowData >> at: indx [ - ^ self atIndex: indx + ^ indx isInteger + ifTrue: [self atIndex: indx] + ifFalse: [ self atFieldNamed: indx ] +] + +{ #category : #accessing } +MySQLQueryRowData >> atFieldNamed: aName [ + ^ self atIndex: (self indexOfFieldNamed: aName) + ] { #category : #accessing } @@ -27,6 +43,11 @@ MySQLQueryRowData >> columnCount: aCount [ ] +{ #category : #enumerating } +MySQLQueryRowData >> do: aBlock [ + ^columns do: aBlock +] + { #category : #accessing } MySQLQueryRowData >> fields [ ^ fields @@ -37,6 +58,12 @@ MySQLQueryRowData >> fields: anObject [ fields := anObject ] +{ #category : #accessing } +MySQLQueryRowData >> indexOfFieldNamed: aName [ + self fields doWithIndex: [ :f :idx | f name = aName ifTrue: [ ^idx ] ]. + ^0 +] + { #category : #accessing } MySQLQueryRowData >> last [ ^ columns atIndex: (columns size) diff --git a/MySQL-Core/MysqlResult.class.st b/MySQL-Core/MySQLResult.class.st similarity index 100% rename from MySQL-Core/MysqlResult.class.st rename to MySQL-Core/MySQLResult.class.st diff --git a/MySQL-Core/MysqlResultSet.class.st b/MySQL-Core/MySQLResultSet.class.st similarity index 95% rename from MySQL-Core/MysqlResultSet.class.st rename to MySQL-Core/MySQLResultSet.class.st index e794c50..e113311 100644 --- a/MySQL-Core/MysqlResultSet.class.st +++ b/MySQL-Core/MySQLResultSet.class.st @@ -16,6 +16,11 @@ Class { #category : #'MySQL-Core-Packet-Results' } +{ #category : #converting } +MySQLResultSet >> asJSON [ + ^NeoJSONWriter toString: (self rows collect: [ :ea | ea asDictionary ]) +] + { #category : #testing } MySQLResultSet >> atEnd [ diff --git a/MySQL-Core/MysqlResultSetHeader.class.st b/MySQL-Core/MySQLResultSetHeader.class.st similarity index 100% rename from MySQL-Core/MysqlResultSetHeader.class.st rename to MySQL-Core/MySQLResultSetHeader.class.st diff --git a/MySQL-Core/MysqlRowData.class.st b/MySQL-Core/MySQLRowData.class.st similarity index 100% rename from MySQL-Core/MysqlRowData.class.st rename to MySQL-Core/MySQLRowData.class.st diff --git a/MySQL-Core/MysqlServerStatus.class.st b/MySQL-Core/MySQLServerStatus.class.st similarity index 100% rename from MySQL-Core/MysqlServerStatus.class.st rename to MySQL-Core/MySQLServerStatus.class.st diff --git a/MySQL-Core/MysqlStringRowData.class.st b/MySQL-Core/MySQLStringRowData.class.st similarity index 100% rename from MySQL-Core/MysqlStringRowData.class.st rename to MySQL-Core/MySQLStringRowData.class.st diff --git a/MySQL-Core/MysqlTypes.class.st b/MySQL-Core/MySQLTypes.class.st similarity index 100% rename from MySQL-Core/MysqlTypes.class.st rename to MySQL-Core/MySQLTypes.class.st diff --git a/MySQL-Core/MysqlUnsuportedAuthError.class.st b/MySQL-Core/MySQLUnsuportedAuthError.class.st similarity index 100% rename from MySQL-Core/MysqlUnsuportedAuthError.class.st rename to MySQL-Core/MySQLUnsuportedAuthError.class.st diff --git a/MySQL-Core/MysqlUnsupportedProtocolError.class.st b/MySQL-Core/MySQLUnsupportedProtocolError.class.st similarity index 100% rename from MySQL-Core/MysqlUnsupportedProtocolError.class.st rename to MySQL-Core/MySQLUnsupportedProtocolError.class.st diff --git a/MySQL-Glorp/MySQLDatabaseDriver.class.st b/MySQL-Glorp/MySQLDatabaseDriver.class.st index e192589..78eaeb6 100644 --- a/MySQL-Glorp/MySQLDatabaseDriver.class.st +++ b/MySQL-Glorp/MySQLDatabaseDriver.class.st @@ -1,3 +1,8 @@ +" +I am a Glorp database driver implementation for using MySQL with Glorp. + +The Glorp database driver provides a unifying common interface for interacting with SQL databases. +" Class { #name : #MySQLDatabaseDriver, #superclass : #DatabaseDriver, diff --git a/scripts/setup-RDBMS.sh b/scripts/setup-RDBMS.sh old mode 100644 new mode 100755