Skip to content

Commit

Permalink
fix(modelql)!: disable implicit queries to avoid accidental performan…
Browse files Browse the repository at this point in the history
…ce issues

You should fix the unintended implicit queries or use .query explicitly.
You can also set the environment variable MODELQL_IMPLICIT_QUERIES_ENABLED=true to re-enable this
feature.
  • Loading branch information
slisson committed Dec 8, 2024
1 parent b7734da commit 6ba247c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class TypedModelQLTest {
.untyped()
.toList()
}.map { it.typed<StaticMethodDeclaration>() }
assertEquals("plus", result[0].name)
assertEquals("plus", result[0].query { it.name })
}

@Test
Expand All @@ -239,7 +239,7 @@ class TypedModelQLTest {
.filter { it.visibility.instanceOf(C_PublicVisibility) }
.toList()
}
assertEquals("plus", result[0].name)
assertEquals("plus", result[0].query { it.name })
}

@Test
Expand All @@ -257,8 +257,9 @@ class TypedModelQLTest {
.member
.ofConcept(C_StaticMethodDeclaration)
.first()
.name
}
assertEquals(expected, actual.name)
assertEquals(expected, actual)
}

@Test
Expand Down Expand Up @@ -297,7 +298,7 @@ class TypedModelQLTest {
.first()
}
assertNotEquals(expected, oldValue)
assertEquals(expected, actual.variableDeclaration.name)
assertEquals(expected, actual.query { it.variableDeclaration.name })
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
package org.modelix.modelql.client

actual val implicitQueriesEnabled: Boolean
get() = false
get() = false

0 comments on commit 6ba247c

Please sign in to comment.