Skip to content

Commit

Permalink
chore: add compat and modify insert fxn
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcharis committed Sep 8, 2024
1 parent bf09018 commit 19dd23a
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions src/Jorm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -411,34 +411,9 @@ end
# Function to perform bulk insert
function bulk_insert!(db::SQLite.DB, model::Type, data::Vector)
query, params = bulk_insert_sql(model, data)

# Execute the query within a transaction for better performance
# Jorm.execute_query(db, RawSQL("BEGIN TRANSACTION;"))
Jorm.execute_query(db, query, params)
# Jorm.execute_query(db, RawSQL("COMMIT;"))
end


# function bulk_update!(db::SQLite.DB, model::Type, data::Vector{model})
# # Start a transaction for better performance
# Jorm.execute_query(db, "BEGIN TRANSACTION;")

# for item in data
# # Generate the SQL query for updating a record
# columns = join([string(field, " = ?") for field in fieldnames(model)], ", ")
# query = "UPDATE $(tablename(model)) SET $columns WHERE id = ?"

# # Prepare the parameters
# params = Any[getfield(item, field) for field in fieldnames(model)]
# push!(params, item.id) # Add the id for the WHERE clause

# # Execute the update query
# Jorm.execute_query(db, query, params)
# end

# # Commit the transaction
# Jorm.execute_query(db, "COMMIT;")
# end
end


include("JormUtils.jl")

Expand Down

2 comments on commit 19dd23a

@Jcharis
Copy link
Member Author

@Jcharis Jcharis commented on 19dd23a Sep 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • First Jorm.jl Release
  • Support SQLite
  • Fix Compat and dep versions

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/114749

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" 19dd23a03b1c0b726bfb3a4034c8d4b42458266d
git push origin v1.0.1

Also, note the warning: This looks like a new registration that registers version 1.0.1.
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.