Skip to content

Commit e8454a4

Browse files
committed
Initial commit after reengineering of PostgresqlDAO
1 parent b8af158 commit e8454a4

54 files changed

Lines changed: 55617 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Manifest.toml

Lines changed: 457 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Project.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,16 @@ name = "PostgresORM"
22
uuid = "748b5efa-ed57-4836-b183-a38105a77fdd"
33
authors = ["Vincent Laugier <vincent.laugier@gmail.com>"]
44
version = "0.1.0"
5+
6+
[deps]
7+
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
8+
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
9+
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
10+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
11+
LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1"
12+
Query = "1a8c2f83-1ff3-5112-b086-8aa67b057ba1"
13+
StringCases = "f22f4433-750e-5048-95f9-cae576f2c120"
14+
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
15+
TickTock = "9ff05d80-102d-5586-aa04-3a8bd1a90d20"
16+
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
17+
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# PostgresORM.jl
22

3-
An Julia library for Object Relational Mapping between Julia structures and PostgreSQL
4-
3+
An Julia library for Object Relational Mapping between Julia and PostgreSQL.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
find -name "*.jl" -exec sed -i "s/PostgresqlDAO/PostgresORM/g" {} +
2+
find -name "*.jl" -exec sed -i "s/DAO/ORM/g" {} +
3+
find -name "*.jl" -exec sed -i "s/dao/orm/g" {} +
4+
find -name "*.jl" -exec sed -i "s/getorm/get_orm/g" {} +

src/Controller/ModificationORM.jl

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
data_type = Modification
2+
PostgresORM.get_orm(x::Modification) = return(ModificationORM)
3+
gettablename() = "modification"
4+
get_table_name() = gettablename()
5+
get_schema_name() = "public"
6+
# The format of the mapping is: `property name = "column name"`
7+
8+
const columns_selection_and_mapping = Dict(:id => "id",
9+
:entity_type => "entity_type",
10+
:entity_id => "entity_id",
11+
:attrname => "attrname",
12+
:oldvalue => "oldvalue",
13+
:newvalue => "newvalue",
14+
:appuser_id => "user_id",
15+
:action_id => "action_id",
16+
:action_type => "action_type",
17+
:creation_time => "creation_time")
18+
19+
const id_property = :id
20+
21+
# A dictionnary of mapping between fields symbols and overriding types
22+
# Left hanside is the field symbol ; right hand side is the type override
23+
types_override = Dict()
24+
25+
const track_changes = false
26+
#
27+
# function create_modification(new_object::Modification)
28+
# dbconn = opendbconn()
29+
# result = create_entity!(new_object,
30+
# dbconn)
31+
# closedbconn(dbconn)
32+
# return result
33+
# end
34+
#
35+
# function update_modification(new_object::Modification)
36+
# dbconn = opendbconn()
37+
# result = update_entity!(new_object,
38+
# dbconn)
39+
# closedbconn(dbconn)
40+
# return result
41+
# end
42+
#
43+
# function retrieve_modification(filter_object::Union{Modification,Missing};
44+
# include_users = false)
45+
# dbconn = opendbconn()
46+
#
47+
# result = retrieve_entity(filter_object,
48+
# data_type,
49+
# table_name,
50+
# columns_selection_and_mapping,
51+
# true, # retrieve_complex_props
52+
# dbconn)
53+
#
54+
#
55+
# closedbconn(dbconn)
56+
# return result
57+
# end
58+
#
59+
# function retrieve_modification()
60+
# retrieve_modification(missing)
61+
# end

0 commit comments

Comments
 (0)