Skip to content

Commit

Permalink
Merge pull request #1627 from Logflare/staging
Browse files Browse the repository at this point in the history
Release v1.3.19
  • Loading branch information
chasers authored Jul 17, 2023
2 parents 13017e2 + 0ebd6fa commit 958a2f5
Show file tree
Hide file tree
Showing 32 changed files with 943 additions and 879 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.18
1.3.19
1 change: 1 addition & 0 deletions assets/js/interfaces/EndpointEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const EndpointEditor = ({
const [queryParams, setQueryParams] = useState({
name: endpoint?.name || defaultValues?.name || "",
query: endpoint?.query || "",
language: "bq_sql"
})
const [testParams, setTestParams] = useState({})
const handleSubmit = (e) => {
Expand Down
1 change: 1 addition & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ config :logflare, Logflare.Repo,
pool_size: 10,
pool: Ecto.Adapters.SQL.Sandbox

config :logflare, :postgres_backend_adapter, pool_size: 3
config :grpc, start_server: false
144 changes: 72 additions & 72 deletions docs/docs.logflare.com/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions lib/logflare/backends.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ defmodule Logflare.Backends do
|> Enum.map(fn sb -> typecast_config_string_map_to_atom_map(sb) end)
end

@doc """
Lists `SourceBackend`s by user
"""
@spec list_source_backends_by_user_id(integer()) :: [SourceBackend.t()]
def list_source_backends_by_user_id(id) when is_integer(id) do
from(sb in SourceBackend, join: s in Source, on: true, where: s.user_id == ^id)
|> Repo.all()
|> Enum.map(fn sb -> typecast_config_string_map_to_atom_map(sb) end)
end

@doc """
Creates a SourceBackend for a given source.
"""
Expand Down Expand Up @@ -189,6 +199,18 @@ defmodule Logflare.Backends do
end
end

@doc """
Ensures that a the SourceSup is started. Only returns error tuple if not alreadt started
"""
@spec ensure_source_sup_started(Source.t()) :: :ok | {:error, term()}
def ensure_source_sup_started(%Source{} = source) do
case start_source_sup(source) do
{:ok, _pid} -> :ok
{:error, :already_started} -> :ok
{:error, _} = err -> err
end
end

@doc """
Stops a given SourceSup for a source. if not started, it will return an error tuple.
"""
Expand Down
Loading

0 comments on commit 958a2f5

Please sign in to comment.