Skip to content

Commit f8b85fe

Browse files
author
MongoCamp CI
committed
ci: update version after release
1 parent dde85f7 commit f8b85fe

18 files changed

+170
-161
lines changed

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"name": "mongodb-driver",
3-
"organization": "dev.mongocamp",
4-
"version": "2.8.0",
5-
"author": "[email protected]",
6-
"license": "Apache-2.0",
7-
"type": "module",
8-
"repository": {
9-
"type": "git",
10-
"url": "git+https://github.com/MongoCamp/mongodb-driver.git"
2+
"name" : "mongodb-driver",
3+
"organization" : "dev.mongocamp",
4+
"version" : "2.8.1.snapshot",
5+
"author" : "[email protected]",
6+
"license" : "Apache-2.0",
7+
"type" : "module",
8+
"repository" : {
9+
"type" : "git",
10+
"url" : "git+https://github.com/MongoCamp/mongodb-driver.git"
1111
},
12-
"bugs": {
13-
"url": "https://github.com/MongoCamp/mongodb-driver/issues"
12+
"bugs" : {
13+
"url" : "https://github.com/MongoCamp/mongodb-driver/issues"
1414
},
15-
"homepage": "https://mongodb-driver.mongocamp.dev/",
16-
"scripts": {
17-
"docs:serve": "vitepress serve docs --port 5555",
18-
"docs:build": "pnpm docs:external; vitepress build docs",
19-
"docs:external": "sh docs/external/fileloader.sh",
20-
"docs:dev": "pnpm docs:external; vitepress dev docs"
15+
"homepage" : "https://mongodb-driver.mongocamp.dev/",
16+
"scripts" : {
17+
"docs:serve" : "vitepress serve docs --port 5555",
18+
"docs:build" : "pnpm docs:external; vitepress build docs",
19+
"docs:external" : "sh docs/external/fileloader.sh",
20+
"docs:dev" : "pnpm docs:external; vitepress dev docs"
2121
},
22-
"devDependencies": {
23-
"@iconify-json/fluent-emoji": "^1.2.1",
24-
"@unocss/preset-icons": "^0.63.4",
25-
"unocss": "^0.63.4",
26-
"vitepress": "1.4.1"
22+
"devDependencies" : {
23+
"@iconify-json/fluent-emoji" : "^1.2.1",
24+
"@unocss/preset-icons" : "^0.63.4",
25+
"unocss" : "^0.63.4",
26+
"vitepress" : "1.4.1"
2727
}
2828
}

src/main/scala-2.13/dev/mongocamp/driver/mongodb/schema/CirceProductSchema.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ trait CirceProductSchema {
1414
internalProduct.productElementNames
1515
}
1616

17-
}
17+
}

src/main/scala/dev/mongocamp/driver/mongodb/database/MongoConfig.scala

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,45 @@ package dev.mongocamp.driver.mongodb.database
33
import java.util.concurrent.TimeUnit
44
import com.mongodb.MongoCompressor
55
import com.mongodb.MongoCredential.createCredential
6-
import com.mongodb.event.{CommandListener, ConnectionPoolListener}
7-
import com.typesafe.config.{Config, ConfigFactory}
8-
import dev.mongocamp.driver.mongodb.database.MongoConfig.{CompressionSnappy, CompressionZlib, CompressionZstd, DefaultApplicationName, DefaultAuthenticationDatabaseName, DefaultHost, DefaultPort}
6+
import com.mongodb.event.{ CommandListener, ConnectionPoolListener }
7+
import com.typesafe.config.{ Config, ConfigFactory }
8+
import dev.mongocamp.driver.mongodb.database.MongoConfig.{
9+
CompressionSnappy,
10+
CompressionZlib,
11+
CompressionZstd,
12+
DefaultApplicationName,
13+
DefaultAuthenticationDatabaseName,
14+
DefaultHost,
15+
DefaultPort
16+
}
917
import org.mongodb.scala.connection._
10-
import org.mongodb.scala.{MongoClientSettings, MongoCredential, ServerAddress}
18+
import org.mongodb.scala.{ MongoClientSettings, MongoCredential, ServerAddress }
1119

1220
import scala.jdk.CollectionConverters._
1321
import scala.collection.mutable.ArrayBuffer
1422

1523
case class MongoConfig(
16-
database: String,
17-
host: String = DefaultHost,
18-
port: Int = DefaultPort,
19-
var applicationName: String = DefaultApplicationName,
20-
userName: Option[String] = None,
21-
password: Option[String] = None,
22-
authDatabase: String = DefaultAuthenticationDatabaseName,
23-
poolOptions: MongoPoolOptions = MongoPoolOptions(),
24-
compressors: List[String] = List.empty,
25-
connectionPoolListener: List[ConnectionPoolListener] = List.empty,
26-
commandListener: List[CommandListener] = List.empty,
27-
customClientSettings: Option[MongoClientSettings] = None,
28-
serverAddressList: List[ServerAddress] = List.empty
29-
) {
24+
database: String,
25+
host: String = DefaultHost,
26+
port: Int = DefaultPort,
27+
var applicationName: String = DefaultApplicationName,
28+
userName: Option[String] = None,
29+
password: Option[String] = None,
30+
authDatabase: String = DefaultAuthenticationDatabaseName,
31+
poolOptions: MongoPoolOptions = MongoPoolOptions(),
32+
compressors: List[String] = List.empty,
33+
connectionPoolListener: List[ConnectionPoolListener] = List.empty,
34+
commandListener: List[CommandListener] = List.empty,
35+
customClientSettings: Option[MongoClientSettings] = None,
36+
serverAddressList: List[ServerAddress] = List.empty
37+
) {
3038

3139
val clientSettings: MongoClientSettings = {
3240
if (customClientSettings.isDefined) {
3341
customClientSettings.get
3442
}
3543
else {
36-
val internalServerAddressList = if (serverAddressList.nonEmpty) serverAddressList else List(new ServerAddress(host, port))
44+
val internalServerAddressList = if (serverAddressList.nonEmpty) serverAddressList else List(new ServerAddress(host, port))
3745
val clusterSettings: ClusterSettings = ClusterSettings.builder().hosts(internalServerAddressList.asJava).build()
3846

3947
val connectionPoolSettingsBuilder = ConnectionPoolSettings
@@ -137,5 +145,4 @@ object MongoConfig extends ConfigHelper {
137145
MongoConfig(database, host, port, applicationName, userName, password, authDatabase, poolOptions, compressors)
138146
}
139147

140-
141148
}

src/main/scala/dev/mongocamp/driver/mongodb/jdbc/MongoJdbcCloseable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package dev.mongocamp.driver.mongodb.jdbc
22

3-
import java.sql.{SQLException, SQLFeatureNotSupportedException}
3+
import java.sql.{ SQLException, SQLFeatureNotSupportedException }
44

55
trait MongoJdbcCloseable extends AutoCloseable {
66

src/main/scala/dev/mongocamp/driver/mongodb/jdbc/MongoJdbcConnection.scala

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,22 @@ import dev.mongocamp.driver.mongodb.bson.BsonConverter
55
import dev.mongocamp.driver.mongodb.database.DatabaseProvider
66
import dev.mongocamp.driver.mongodb.jdbc.statement.MongoPreparedStatement
77

8-
import java.{sql, util}
9-
import java.sql.{Blob, CallableStatement, Clob, Connection, DatabaseMetaData, NClob, PreparedStatement, SQLException, SQLWarning, SQLXML, Savepoint, Statement, Struct}
8+
import java.{ sql, util }
9+
import java.sql.{
10+
Blob,
11+
CallableStatement,
12+
Clob,
13+
Connection,
14+
DatabaseMetaData,
15+
NClob,
16+
PreparedStatement,
17+
SQLException,
18+
SQLWarning,
19+
SQLXML,
20+
Savepoint,
21+
Statement,
22+
Struct
23+
}
1024
import java.util.Properties
1125
import java.util.concurrent.Executor
1226
import scala.jdk.CollectionConverters._
@@ -110,51 +124,51 @@ class MongoJdbcConnection(databaseProvider: DatabaseProvider) extends Connection
110124
createMongoStatement(Some(sql))
111125
}
112126

113-
override def getTypeMap: util.Map[String, Class[_]] = {
127+
override def getTypeMap: util.Map[String, Class[_]] = {
114128
checkClosed()
115129
null
116130
}
117131

118-
override def setTypeMap(map: util.Map[String, Class[_]]): Unit = {
132+
override def setTypeMap(map: util.Map[String, Class[_]]): Unit = {
119133
checkClosed()
120134
}
121135

122-
override def setHoldability(holdability: Int): Unit = {
136+
override def setHoldability(holdability: Int): Unit = {
123137
checkClosed()
124138
}
125139

126-
override def getHoldability: Int = {
140+
override def getHoldability: Int = {
127141
checkClosed()
128142
0
129143
}
130144

131-
override def setSavepoint(): Savepoint = {
145+
override def setSavepoint(): Savepoint = {
132146
checkClosed()
133147
null
134148
}
135149

136-
override def setSavepoint(name: String): Savepoint = {
150+
override def setSavepoint(name: String): Savepoint = {
137151
checkClosed()
138152
null
139153
}
140154

141-
override def rollback(savepoint: Savepoint): Unit = {
155+
override def rollback(savepoint: Savepoint): Unit = {
142156
checkClosed()
143157
}
144158

145-
override def releaseSavepoint(savepoint: Savepoint): Unit = {
159+
override def releaseSavepoint(savepoint: Savepoint): Unit = {
146160
checkClosed()
147161
}
148162

149-
override def createStatement(resultSetType: Int, resultSetConcurrency: Int, resultSetHoldability: Int): Statement = {
163+
override def createStatement(resultSetType: Int, resultSetConcurrency: Int, resultSetHoldability: Int): Statement = {
150164
createMongoStatement()
151165
}
152166

153167
override def prepareStatement(sql: String, resultSetType: Int, resultSetConcurrency: Int, resultSetHoldability: Int): PreparedStatement = {
154168
createMongoStatement(Option(sql))
155169
}
156170

157-
override def prepareCall(sql: String, resultSetType: Int, resultSetConcurrency: Int, resultSetHoldability: Int): CallableStatement = {
171+
override def prepareCall(sql: String, resultSetType: Int, resultSetConcurrency: Int, resultSetHoldability: Int): CallableStatement = {
158172
checkClosed()
159173
createMongoStatement(Some(sql))
160174
}
@@ -171,27 +185,27 @@ class MongoJdbcConnection(databaseProvider: DatabaseProvider) extends Connection
171185
createMongoStatement(Option(sql))
172186
}
173187

174-
override def createClob(): Clob = {
188+
override def createClob(): Clob = {
175189
checkClosed()
176190
null
177191
}
178192

179-
override def createBlob(): Blob = {
193+
override def createBlob(): Blob = {
180194
checkClosed()
181195
null
182196
}
183197

184-
override def createNClob(): NClob = {
198+
override def createNClob(): NClob = {
185199
checkClosed()
186200
null
187201
}
188202

189-
override def createSQLXML(): SQLXML = {
203+
override def createSQLXML(): SQLXML = {
190204
checkClosed()
191205
null
192206
}
193207

194-
override def isValid(timeout: Int): Boolean = {
208+
override def isValid(timeout: Int): Boolean = {
195209
checkClosed()
196210
true
197211
}
@@ -214,8 +228,9 @@ class MongoJdbcConnection(databaseProvider: DatabaseProvider) extends Connection
214228
checkClosed()
215229
if ("ApplicationName".equalsIgnoreCase(name) || "appName".equalsIgnoreCase(name) || "name".equalsIgnoreCase(name)) {
216230
databaseProvider.config.applicationName
217-
} else {
218-
null
231+
}
232+
else {
233+
null
219234
}
220235
}
221236

src/main/scala/dev/mongocamp/driver/mongodb/jdbc/MongoJdbcDriver.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package dev.mongocamp.driver.mongodb.jdbc
22

33
import com.vdurmont.semver4j.Semver
44
import dev.mongocamp.driver.mongodb.BuildInfo
5-
import dev.mongocamp.driver.mongodb.database.{DatabaseProvider, MongoConfig}
6-
import org.mongodb.scala.{ConnectionString, ServerAddress}
5+
import dev.mongocamp.driver.mongodb.database.{ DatabaseProvider, MongoConfig }
6+
import org.mongodb.scala.{ ConnectionString, ServerAddress }
77

8-
import java.sql.{Connection, DriverPropertyInfo}
8+
import java.sql.{ Connection, DriverPropertyInfo }
99
import java.util.Properties
1010
import java.util.logging.Logger
1111
import scala.jdk.CollectionConverters._
@@ -15,8 +15,7 @@ class MongoJdbcDriver extends java.sql.Driver {
1515

1616
private lazy val semVer = new Semver(BuildInfo.version)
1717

18-
/**
19-
* Connect to the database using a URL like : jdbc:mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] The
18+
/** Connect to the database using a URL like : jdbc:mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] The
2019
* URL excepting the jdbc: prefix is passed as it is to the MongoDb native Java driver.
2120
*/
2221
override def connect(url: String, info: Properties): Connection = {
@@ -28,9 +27,9 @@ class MongoJdbcDriver extends java.sql.Driver {
2827
val username = Option(info.getProperty(MongodbJdbcDriverPropertyInfoHelper.AuthUser)).filter(_.trim.nonEmpty)
2928
val password = Option(info.getProperty(MongodbJdbcDriverPropertyInfoHelper.AuthPassword)).filter(_.trim.nonEmpty)
3029

31-
val string = new ConnectionString(connectionUrl)
30+
val string = new ConnectionString(connectionUrl)
3231
val database = Option(string.getDatabase).getOrElse(Option(info.getProperty(MongodbJdbcDriverPropertyInfoHelper.Database)).getOrElse("admin"))
33-
val authDb = Option(info.getProperty(MongodbJdbcDriverPropertyInfoHelper.AuthDatabase)).getOrElse(Option(string.getDatabase).getOrElse("admin"))
32+
val authDb = Option(info.getProperty(MongodbJdbcDriverPropertyInfoHelper.AuthDatabase)).getOrElse(Option(string.getDatabase).getOrElse("admin"))
3433
val provider = DatabaseProvider(
3534
MongoConfig(
3635
database,

src/main/scala/dev/mongocamp/driver/mongodb/jdbc/MongodbJdbcDriverPropertyInfoHelper.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import MongodbJdbcDriverPropertyInfoHelper._
33

44
object MongodbJdbcDriverPropertyInfoHelper {
55
val ApplicationName = "appName"
6-
val Database = "database"
6+
val Database = "database"
77

8-
val AuthUser = "user"
9-
val AuthPassword = "password"
8+
val AuthUser = "user"
9+
val AuthPassword = "password"
1010
val AuthDatabase = "auth_database"
1111
val DefaultAuthDB = "admin"
1212
val DefaultAppName = "mongodb-driver"

src/main/scala/dev/mongocamp/driver/mongodb/jdbc/resultSet/MongoDbResultSetMetaData.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package dev.mongocamp.driver.mongodb.jdbc.resultSet
22

33
import dev.mongocamp.driver.mongodb.MongoDAO
44
import org.mongodb.scala.Document
5-
import org.mongodb.scala.bson.{BsonBoolean, BsonInt32, BsonInt64, BsonNumber, BsonString}
5+
import org.mongodb.scala.bson.{ BsonBoolean, BsonInt32, BsonInt64, BsonNumber, BsonString }
66
import dev.mongocamp.driver.mongodb._
77

8-
import java.sql.{ResultSetMetaData, SQLException}
8+
import java.sql.{ ResultSetMetaData, SQLException }
99

1010
class MongoDbResultSetMetaData extends ResultSetMetaData {
1111
private var document: Document = _
@@ -32,9 +32,9 @@ class MongoDbResultSetMetaData extends ResultSetMetaData {
3232
}
3333

3434
private def extractDocumentFromDataList(data: List[Document]) = {
35-
var row = data.headOption.getOrElse(throw new SQLException("No data in ResultSet")).copy()
35+
var row = data.headOption.getOrElse(throw new SQLException("No data in ResultSet")).copy()
3636
val distinctKeys = data.flatMap(_.keys).distinct
37-
val missingKeys = distinctKeys.diff(row.keys.toSeq)
37+
val missingKeys = distinctKeys.diff(row.keys.toSeq)
3838
missingKeys.foreach(key => {
3939
data
4040
.find(_.get(key).nonEmpty)

0 commit comments

Comments
 (0)