# PostgreSQLDatabaseAdapter.db_adapterFunction.

db_adapter() :: Symbol

The name of the underlying database adapter (driver).

source

# PostgreSQLDatabaseAdapter.connectFunction.

connect(conn_data::Dict{String,Any}) :: DatabaseHandle

Connects to the database and returns a handle.

source

# PostgreSQLDatabaseAdapter.create_databaseFunction.

create_database(db_name::String) :: Bool

Creates the database db_name. Returns true on success - false on failure

source

# PostgreSQLDatabaseAdapter.table_columns_sqlFunction.

table_columns_sql(table_name::AbstractString) :: String

Returns the adapter specific query for SELECTing table columns information corresponding to table_name.

source

# PostgreSQLDatabaseAdapter.create_migrations_tableFunction.

create_migrations_table(table_name::String) :: Bool

Runs a SQL DB query that creates the table table_name with the structure needed to be used as the DB migrations table. The table should contain one column, version, unique, as a string of maximum 30 chars long. Returns true on success.

source

# PostgreSQLDatabaseAdapter.escape_column_nameFunction.

escape_column_name(c::AbstractString, conn::DatabaseHandle) :: String

Escapes the column name using native features provided by the database backend.

Examples

julia> PostgreSQLDatabaseAdapter.escape_column_name("foo"; DROP moo;", Database.connection())
""foo""; DROP moo;""

source

# PostgreSQLDatabaseAdapter.escape_valueFunction.

escape_value{T}(v::T, conn::DatabaseHandle) :: T

Escapes the value v using native features provided by the database backend.

Examples

julia> PostgreSQLDatabaseAdapter.escape_value("'; DROP moo;", Database.connection())
"'''; DROP moo;'"

julia> PostgreSQLDatabaseAdapter.escape_value(SQLInput(22), Database.connection())
22

julia> PostgreSQLDatabaseAdapter.escape_value(SQLInput("hello"), Database.connection())
'hello'

source

# PostgreSQLDatabaseAdapter.query_dfFunction.

query_df(sql::AbstractString, suppress_output::Bool, conn::DatabaseHandle) :: DataFrames.DataFrame

Executes the sql query against the database backend and returns a DataFrame result.

Examples:

julia> PostgreSQLDatabaseAdapter.query_df(SearchLight.to_fetch_sql(Article, SQLQuery(limit = 5)), false, Database.connection())

2017-01-16T21:36:21.566 - info: SQL QUERY: SELECT "articles"."id" AS "articles_id", "articles"."title" AS "articles_title", "articles"."summary" AS "articles_summary", "articles"."content" AS "articles_content", "articles"."updated_at" AS "articles_updated_at", "articles"."published_at" AS "articles_published_at", "articles"."slug" AS "articles_slug" FROM "articles" LIMIT 5

  0.000985 seconds (16 allocations: 576 bytes)

5×7 DataFrames.DataFrame
...

source

# PostgreSQLDatabaseAdapter.queryFunction.

source

# PostgreSQLDatabaseAdapter.relation_to_sqlFunction.

source

# PostgreSQLDatabaseAdapter.to_find_sqlFunction.

source

# PostgreSQLDatabaseAdapter.to_store_sqlFunction.

source

# PostgreSQLDatabaseAdapter.delete_allFunction.

source

# PostgreSQLDatabaseAdapter.deleteFunction.

source

# PostgreSQLDatabaseAdapter.countFunction.

source

# PostgreSQLDatabaseAdapter.update_query_partFunction.

source

# PostgreSQLDatabaseAdapter.column_data_to_column_nameFunction.

source

# PostgreSQLDatabaseAdapter.to_select_partFunction.

source

# PostgreSQLDatabaseAdapter.to_from_partFunction.

source

# PostgreSQLDatabaseAdapter.to_where_partFunction.

source

# PostgreSQLDatabaseAdapter.required_scopesFunction.

source

# PostgreSQLDatabaseAdapter.scopesFunction.

source

# PostgreSQLDatabaseAdapter.to_order_partFunction.

source

# PostgreSQLDatabaseAdapter.to_group_partFunction.

source

# PostgreSQLDatabaseAdapter.to_limit_partFunction.

source

# PostgreSQLDatabaseAdapter.to_offset_partFunction.

source

# PostgreSQLDatabaseAdapter.to_having_partFunction.

source

# PostgreSQLDatabaseAdapter.to_join_partFunction.

source