Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SQL Server support #10324

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2b3aaae
Add folder and yaml
AdRiley Jul 19, 2024
5faac8c
Update build.sbt
AdRiley Jul 19, 2024
ca37582
fix
AdRiley Jul 19, 2024
a70d306
Fix
AdRiley Jul 19, 2024
a02f3d5
Update Editions.scala
AdRiley Jul 19, 2024
5483a4b
fix
AdRiley Jul 19, 2024
b330ffd
Add SPI
AdRiley Jul 19, 2024
c337daf
Add test files
AdRiley Jul 19, 2024
ff0f2a1
Stash
AdRiley Jul 19, 2024
8386351
stash
AdRiley Jul 19, 2024
8646bc9
Failing test
AdRiley Jul 19, 2024
b6f4226
Connecting to SQLServer but with bad SQL
AdRiley Jul 19, 2024
8a19c0c
Passing tests
AdRiley Jul 19, 2024
4f5d76e
Green
AdRiley Jul 19, 2024
cb86edf
Green
AdRiley Jul 19, 2024
faaad86
Greenish
AdRiley Jul 19, 2024
2654634
Refactor
AdRiley Jul 19, 2024
aa87b76
Green
AdRiley Jul 19, 2024
dded0c6
Closer to green
AdRiley Jul 19, 2024
9b13b89
Green
AdRiley Jul 19, 2024
bedad5d
Cleanup
AdRiley Jul 19, 2024
09eed17
Remove for now
AdRiley Jul 19, 2024
ac43777
Byte
AdRiley Jul 19, 2024
901a9b8
Integer types
AdRiley Jul 19, 2024
4f7a54b
Refactor
AdRiley Jul 19, 2024
0b84284
Floating point types
AdRiley Jul 19, 2024
5fae1b0
char types improvements
AdRiley Jul 19, 2024
aa39428
Auto-commit work in progress before clean build on 2024-07-11 14:22:57
AdRiley Jul 19, 2024
47d8b49
fix after rebase
AdRiley Jul 19, 2024
db9dac9
Fixes after merge
AdRiley Jul 19, 2024
e3ca70b
Make time type work
AdRiley Jul 19, 2024
2877bdd
Add date type
AdRiley Jul 19, 2024
d7e0eb5
Add datetime type
AdRiley Jul 19, 2024
d51b634
Add smalldatetime type
AdRiley Jul 19, 2024
be374ec
Add datetime2 type
AdRiley Jul 19, 2024
8584c9d
Add datetimeoffset type
AdRiley Jul 19, 2024
ed91be5
Update value
AdRiley Jul 19, 2024
cfd7c0e
Add binary types
AdRiley Jul 19, 2024
2b5fe69
Refactor
AdRiley Jul 19, 2024
c4666b8
Legal review
AdRiley Jul 19, 2024
ecf696d
Cleanup
AdRiley Jul 19, 2024
cf6c085
Typo
AdRiley Jul 19, 2024
cc2fabf
Fix warning
AdRiley Jul 19, 2024
2da0d2b
Changelog
AdRiley Jul 19, 2024
d74de31
scalafmtSbt
AdRiley Jul 19, 2024
46a5ba3
Add SQLServer to CI
AdRiley Jul 19, 2024
16bcdf0
Fix rust code
AdRiley Jul 19, 2024
879fca8
fmt
AdRiley Jul 19, 2024
a025d2e
Make password meet SQLserver rules
AdRiley Jul 19, 2024
8958e4b
Change the correct password
AdRiley Jul 19, 2024
d5134d6
Disable tests when enviroment vars not set
AdRiley Jul 19, 2024
2f74c17
Fix
AdRiley Jul 19, 2024
4d3bab5
Add licenses
AdRiley Jul 22, 2024
8225e12
Fix
AdRiley Jul 22, 2024
6503146
Fix2
AdRiley Jul 22, 2024
21199a2
Revert "Fix2"
AdRiley Jul 22, 2024
028d995
Revert "Fix"
AdRiley Jul 22, 2024
0267a85
Revert "Add licenses"
AdRiley Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
- [Compare two objects with `Ordering.compare` and define comparator with
`Comparable.new`][10468]
- [Added `dec` construction function for creating `Decimal`s.][10517]
- [Added initial read support for SQLServer][10324]

[10434]: https:/enso-org/enso/pull/10434
[10445]: https:/enso-org/enso/pull/10445
[10466]: https:/enso-org/enso/pull/10466
[10467]: https:/enso-org/enso/pull/10467
[10474]: https:/enso-org/enso/pull/10474
[10517]: https:/enso-org/enso/pull/10517
[10324]: https:/enso-org/enso/pull/10324

# Enso 2024.2

Expand Down
45 changes: 44 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ GatherLicenses.distributions := Seq(
makeStdLibDistribution("Database", Distribution.sbtProjects(`std-database`)),
makeStdLibDistribution("Image", Distribution.sbtProjects(`std-image`)),
makeStdLibDistribution("AWS", Distribution.sbtProjects(`std-aws`)),
makeStdLibDistribution("Snowflake", Distribution.sbtProjects(`std-snowflake`))
makeStdLibDistribution(
"Snowflake",
Distribution.sbtProjects(`std-snowflake`)
),
makeStdLibDistribution("Microsoft", Distribution.sbtProjects(`std-microsoft`))
)

GatherLicenses.licenseConfigurations := Set("compile")
Expand Down Expand Up @@ -345,6 +349,7 @@ lazy val enso = (project in file("."))
`std-table`,
`std-aws`,
`std-snowflake`,
`std-microsoft`,
`http-test-helper`,
`enso-test-java-helpers`,
`exploratory-benchmark-java-helpers`,
Expand Down Expand Up @@ -562,6 +567,7 @@ val fansiVersion = "0.4.0"
val httpComponentsVersion = "4.4.1"
val apacheArrowVersion = "14.0.1"
val snowflakeJDBCVersion = "3.15.0"
val mssqlserverJDBCVersion = "12.6.2.jre11"
val jsoniterVersion = "2.28.5"

// ============================================================================
Expand Down Expand Up @@ -1933,6 +1939,7 @@ lazy val runtime = (project in file("engine/runtime"))
.dependsOn(`std-table` / Compile / packageBin)
.dependsOn(`std-aws` / Compile / packageBin)
.dependsOn(`std-snowflake` / Compile / packageBin)
.dependsOn(`std-microsoft` / Compile / packageBin)
.value
)
.dependsOn(`common-polyglot-core-utils`)
Expand Down Expand Up @@ -3237,6 +3244,8 @@ val `std-aws-polyglot-root` =
stdLibComponentRoot("AWS") / "polyglot" / "java"
val `std-snowflake-polyglot-root` =
stdLibComponentRoot("Snowflake") / "polyglot" / "java"
val `std-microsoft-polyglot-root` =
stdLibComponentRoot("Microsoft") / "polyglot" / "java"

lazy val `std-base` = project
.in(file("std-bits") / "base")
Expand Down Expand Up @@ -3544,6 +3553,36 @@ lazy val `std-snowflake` = project
.dependsOn(`std-table` % "provided")
.dependsOn(`std-database` % "provided")

lazy val `std-microsoft` = project
.in(file("std-bits") / "microsoft")
.settings(
frgaalJavaCompilerSetting,
autoScalaLibrary := false,
Compile / compile / compileInputs := (Compile / compile / compileInputs)
.dependsOn(SPIHelpers.ensureSPIConsistency)
.value,
Compile / packageBin / artifactPath :=
`std-microsoft-polyglot-root` / "std-microsoft.jar",
libraryDependencies ++= Seq(
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
"com.microsoft.sqlserver" % "mssql-jdbc" % mssqlserverJDBCVersion
),
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
val _ = StdBits
.copyDependencies(
`std-microsoft-polyglot-root`,
Seq("std-microsoft.jar"),
ignoreScalaLibrary = true
)
.value
result
}.value
)
.dependsOn(`std-base` % "provided")
.dependsOn(`std-table` % "provided")
.dependsOn(`std-database` % "provided")

/* Note [Native Image Workaround for GraalVM 20.2]
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* In GraalVM 20.2 the Native Image build of even simple Scala programs has
Expand Down Expand Up @@ -3690,6 +3729,7 @@ val stdBitsProjects =
"Database",
"Google_Api",
"Image",
"Microsoft",
"Snowflake",
"Table"
) ++ allStdBitsSuffix
Expand Down Expand Up @@ -3761,6 +3801,8 @@ pkgStdLibInternal := Def.inputTask {
(`std-aws` / Compile / packageBin).value
case "Snowflake" =>
(`std-snowflake` / Compile / packageBin).value
case "Microsoft" =>
(`std-microsoft` / Compile / packageBin).value
case _ if buildAllCmd =>
(`std-base` / Compile / packageBin).value
(`enso-test-java-helpers` / Compile / packageBin).value
Expand All @@ -3772,6 +3814,7 @@ pkgStdLibInternal := Def.inputTask {
(`std-google-api` / Compile / packageBin).value
(`std-aws` / Compile / packageBin).value
(`std-snowflake` / Compile / packageBin).value
(`std-microsoft` / Compile / packageBin).value
case _ =>
}
val libs =
Expand Down
31 changes: 29 additions & 2 deletions build/build/src/enso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ use crate::paths::ENSO_META_TEST_ARGS;
use crate::paths::ENSO_META_TEST_COMMAND;
use crate::paths::ENSO_TEST_ANSI_COLORS;
use crate::postgres;
use crate::postgres::EndpointConfiguration;
use crate::postgres::EndpointConfiguration as PostgresEndpointConfiguration;
use crate::postgres::Postgresql;
use crate::sqlserver;
use crate::sqlserver::EndpointConfiguration as SQLServerEndpointConfiguration;
use crate::sqlserver::SQLServer;

use ide_ci::future::AsyncPolicy;
use ide_ci::programs::docker::ContainerId;
Expand Down Expand Up @@ -147,7 +150,7 @@ impl BuiltEnso {
database_name: "enso_test_db".to_string(),
user: "enso_test_user".to_string(),
password: "enso_test_password".to_string(),
endpoint: EndpointConfiguration::deduce()?,
endpoint: PostgresEndpointConfiguration::deduce()?,
version: "latest".to_string(),
};
let postgres = Postgresql::start(config).await?;
Expand All @@ -156,6 +159,30 @@ impl BuiltEnso {
_ => None,
};

let __sqlserver = match TARGET_OS {
OS::Linux => {
let runner_context_string = crate::env::ENSO_RUNNER_CONTAINER_NAME
.get_raw()
.or_else(|_| ide_ci::actions::env::RUNNER_NAME.get())
.unwrap_or_else(|_| Uuid::new_v4().to_string());
// GH-hosted runners are named like "GitHub Actions 10". Spaces are not allowed in
// the container name.
let container_name =
format!("sqlserver-for-{runner_context_string}").replace(' ', "_");
let config = sqlserver::Configuration {
sqlserver_container: ContainerId(container_name),
database_name: "tempdb".to_string(),
user: "sa".to_string(),
password: "enso_test_password_<YourStrong@Passw0rd>".to_string(),
endpoint: SQLServerEndpointConfiguration::deduce()?,
version: "latest".to_string(),
};
let sqlserver = SQLServer::start(config).await?;
Some(sqlserver)
}
_ => None,
};

let std_tests = crate::paths::discover_standard_library_tests(&paths.repo_root)?;
let futures = std_tests.into_iter().map(|test_path| {
let command = self.run_test(test_path, ir_caches);
Expand Down
1 change: 1 addition & 0 deletions build/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub mod release;
pub mod repo;
pub mod rust;
pub mod source;
pub mod sqlserver;
pub mod version;
pub mod web;

Expand Down
Loading