Skip to content

Commit e308210

Browse files
committed
initial import of several additional commands
1 parent bb1168f commit e308210

8 files changed

Lines changed: 382 additions & 2 deletions

Analyzer/SQLite/Commands/AbstractCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ public void CreateCommand(SqliteConnection database)
3131
}
3232
public void SetValue(string key, object value)
3333
{
34-
if (m_Command.Parameters.Contains(key))
34+
string prefixedKey = $"@{key}";
35+
if (m_Command.Parameters.Contains(prefixedKey))
3536
{
36-
m_Command.Parameters[key].Value = value ?? DBNull.Value;
37+
m_Command.Parameters[prefixedKey].Value = value ?? DBNull.Value;
3738
}
3839
else
3940
{
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using Microsoft.Data.Sqlite;
2+
using System.Collections.Generic;
3+
4+
namespace Analyzer.SQLite.Commands
5+
{
6+
/* TABLE DEFINITION:
7+
create table addr_build_bundles
8+
(
9+
id INTEGER,
10+
build_id INTEGER,
11+
asset_count INTEGER,
12+
build_status INTEGER,
13+
bundle_dependencies TEXT,
14+
crc INTEGER,
15+
compression TEXT,
16+
dependencies TEXT,
17+
dependency_file_size INTEGER,
18+
dependent_bundles TEXT,
19+
expanded_dependencies TEXT,
20+
expanded_dependency_file_size INTEGER,
21+
file_size INTEGER,
22+
files TEXT,
23+
group_rid INTEGER,
24+
hash TEXT,
25+
internal_name TEXT,
26+
load_path TEXT,
27+
name TEXT,
28+
provider TEXT,
29+
result_type TEXT,
30+
PRIMARY KEY (id, build_id)
31+
);
32+
*/
33+
internal class AddressablesBuildBundle : AbstractCommand
34+
{
35+
protected override string TableName => "addr_build_bundles";
36+
37+
protected override Dictionary<string, SqliteType> Fields => new Dictionary<string, SqliteType>
38+
{
39+
{ "id", SqliteType.Integer },
40+
{ "build_id", SqliteType.Integer },
41+
{ "asset_count", SqliteType.Integer },
42+
{ "build_status", SqliteType.Integer },
43+
{ "bundle_dependencies", SqliteType.Text }, // JSONB type in SQLite uses TEXT
44+
{ "crc", SqliteType.Integer },
45+
{ "compression", SqliteType.Text },
46+
{ "dependencies", SqliteType.Text }, // JSONB type in SQLite uses TEXT
47+
{ "dependency_file_size", SqliteType.Integer },
48+
{ "dependent_bundles", SqliteType.Text }, // JSONB type in SQLite uses TEXT
49+
{ "expanded_dependencies", SqliteType.Text }, // JSONB type in SQLite uses TEXT
50+
{ "expanded_dependency_file_size", SqliteType.Integer },
51+
{ "file_size", SqliteType.Integer },
52+
{ "files", SqliteType.Text }, // JSONB type in SQLite uses TEXT
53+
{ "group_rid", SqliteType.Integer },
54+
{ "hash", SqliteType.Text }, // JSON object stored as TEXT
55+
{ "internal_name", SqliteType.Text },
56+
{ "load_path", SqliteType.Text },
57+
{ "name", SqliteType.Text },
58+
{ "provider", SqliteType.Text },
59+
{ "result_type", SqliteType.Text }
60+
};
61+
62+
public AddressablesBuildBundle()
63+
{
64+
}
65+
}
66+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using Microsoft.Data.Sqlite;
2+
using System.Collections.Generic;
3+
4+
namespace Analyzer.SQLite.Commands
5+
{
6+
/* TABLE DEFINITION:
7+
create table addr_build_data_from_other_assets
8+
(
9+
id INTEGER,
10+
build_id INTEGER,
11+
asset_guid TEXT,
12+
asset_path TEXT,
13+
file INTEGER,
14+
main_asset_type INTEGER,
15+
object_count INTEGER,
16+
objects TEXT,
17+
referencing_assets TEXT,
18+
serialized_size INTEGER,
19+
streamed_size INTEGER,
20+
PRIMARY KEY (id, build_id)
21+
);
22+
*/
23+
internal class AddressablesBuildDataFromOtherAsset : AbstractCommand
24+
{
25+
protected override string TableName => "addr_build_data_from_other_assets";
26+
27+
protected override Dictionary<string, SqliteType> Fields => new Dictionary<string, SqliteType>
28+
{
29+
{ "id", SqliteType.Integer },
30+
{ "build_id", SqliteType.Integer },
31+
{ "asset_guid", SqliteType.Text },
32+
{ "asset_path", SqliteType.Text },
33+
{ "file", SqliteType.Integer },
34+
{ "main_asset_type", SqliteType.Integer },
35+
{ "object_count", SqliteType.Integer },
36+
{ "objects", SqliteType.Text }, // JSONB type in SQLite uses TEXT
37+
{ "referencing_assets", SqliteType.Text }, // JSONB type in SQLite uses TEXT
38+
{ "serialized_size", SqliteType.Integer },
39+
{ "streamed_size", SqliteType.Integer }
40+
};
41+
42+
public AddressablesBuildDataFromOtherAsset()
43+
{
44+
}
45+
}
46+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using Microsoft.Data.Sqlite;
2+
using System.Collections.Generic;
3+
4+
namespace Analyzer.SQLite.Commands
5+
{
6+
/* TABLE DEFINITION:
7+
create table addr_build_files
8+
(
9+
id INTEGER,
10+
build_id INTEGER,
11+
assets TEXT,
12+
bundle INTEGER,
13+
bundle_object_info_size INTEGER,
14+
external_references TEXT,
15+
mono_script_count INTEGER,
16+
mono_script_size INTEGER,
17+
name TEXT,
18+
other_assets TEXT,
19+
preload_info_size INTEGER,
20+
sub_files TEXT,
21+
write_result_filename TEXT,
22+
PRIMARY KEY (id, build_id)
23+
);
24+
*/
25+
internal class AddressablesBuildFile : AbstractCommand
26+
{
27+
protected override string TableName => "addr_build_files";
28+
29+
protected override Dictionary<string, SqliteType> Fields => new Dictionary<string, SqliteType>
30+
{
31+
{ "id", SqliteType.Integer },
32+
{ "build_id", SqliteType.Integer },
33+
{ "assets", SqliteType.Text }, // JSONB type in SQLite uses TEXT
34+
{ "bundle", SqliteType.Integer },
35+
{ "bundle_object_info_size", SqliteType.Integer },
36+
{ "external_references", SqliteType.Text }, // JSONB type in SQLite uses TEXT
37+
{ "mono_script_count", SqliteType.Integer },
38+
{ "mono_script_size", SqliteType.Integer },
39+
{ "name", SqliteType.Text },
40+
{ "other_assets", SqliteType.Text }, // JSONB type in SQLite uses TEXT
41+
{ "preload_info_size", SqliteType.Integer },
42+
{ "sub_files", SqliteType.Text }, // JSONB type in SQLite uses TEXT
43+
{ "write_result_filename", SqliteType.Text }
44+
};
45+
46+
public AddressablesBuildFile()
47+
{
48+
}
49+
}
50+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using Microsoft.Data.Sqlite;
2+
using System.Collections.Generic;
3+
4+
namespace Analyzer.SQLite.Commands
5+
{
6+
/* TABLE DEFINITION:
7+
create table addr_build_groups
8+
(
9+
id INTEGER,
10+
build_id INTEGER,
11+
bundles TEXT,
12+
guid TEXT,
13+
name TEXT,
14+
packing_mode TEXT,
15+
schemas TEXT,
16+
PRIMARY KEY (id, build_id)
17+
);
18+
*/
19+
internal class AddressablesBuildGroup : AbstractCommand
20+
{
21+
protected override string TableName => "addr_build_groups";
22+
23+
protected override Dictionary<string, SqliteType> Fields => new Dictionary<string, SqliteType>
24+
{
25+
{ "id", SqliteType.Integer },
26+
{ "build_id", SqliteType.Integer },
27+
{ "bundles", SqliteType.Text }, // JSONB type in SQLite uses TEXT
28+
{ "guid", SqliteType.Text },
29+
{ "name", SqliteType.Text },
30+
{ "packing_mode", SqliteType.Text },
31+
{ "schemas", SqliteType.Text } // JSONB type in SQLite uses TEXT
32+
};
33+
34+
public AddressablesBuildGroup()
35+
{
36+
}
37+
}
38+
}
39+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Microsoft.Data.Sqlite;
2+
using System.Collections.Generic;
3+
4+
namespace Analyzer.SQLite.Commands
5+
{
6+
/* TABLE DEFINITION:
7+
create table addr_build_schemas
8+
(
9+
id INTEGER,
10+
build_id INTEGER,
11+
guid TEXT,
12+
schema_data_pairs TEXT,
13+
type TEXT,
14+
PRIMARY KEY (id, build_id)
15+
);
16+
*/
17+
internal class AddressablesBuildSchema : AbstractCommand
18+
{
19+
protected override string TableName => "addr_build_schemas";
20+
21+
protected override Dictionary<string, SqliteType> Fields => new Dictionary<string, SqliteType>
22+
{
23+
{ "id", SqliteType.Integer },
24+
{ "build_id", SqliteType.Integer },
25+
{ "guid", SqliteType.Text },
26+
{ "schema_data_pairs", SqliteType.Text }, // JSONB type in SQLite uses TEXT
27+
{ "type", SqliteType.Text }
28+
};
29+
30+
public AddressablesBuildSchema()
31+
{
32+
}
33+
}
34+
}
35+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Microsoft.Data.Sqlite;
2+
using System.Collections.Generic;
3+
4+
namespace Analyzer.SQLite.Commands
5+
{
6+
/* TABLE DEFINITION:
7+
create table addr_build_sub_files
8+
(
9+
id INTEGER,
10+
build_id INTEGER,
11+
is_serialized_file INTEGER,
12+
name TEXT,
13+
size INTEGER,
14+
PRIMARY KEY (id, build_id)
15+
);
16+
*/
17+
internal class AddressablesBuildSubFile : AbstractCommand
18+
{
19+
protected override string TableName => "addr_build_sub_files";
20+
21+
protected override Dictionary<string, SqliteType> Fields => new Dictionary<string, SqliteType>
22+
{
23+
{ "id", SqliteType.Integer },
24+
{ "build_id", SqliteType.Integer },
25+
{ "is_serialized_file", SqliteType.Integer },
26+
{ "name", SqliteType.Text },
27+
{ "size", SqliteType.Integer }
28+
};
29+
30+
public AddressablesBuildSubFile()
31+
{
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)