scrollmapper / bible_databases

Bible versions and cross-reference databases.
977 stars 346 forks source link

Fix book_info.sql and dump entire database to sql and sqlite3 #63

Closed Jmainguy closed 2 years ago

Jmainguy commented 3 years ago

book_info.sql had some sqlite3 isms, that was preventing mysql from loading it. I noticed this when using the new docker-compose file. After fixing this, I did a complete to to bible-mysql.sql so that it matches the sum of what is in sql/.

At the same time, I updated the README to reflect that sqlite is not a simplified database, it is really just a different format. It contains all the information from the mysql database, with the addition of the cross reference (The readme did say cross-reference was included, but it actually wasn't included in reality. I have now included it)

This now makes the sqlite3 database, bug 2 bug identical with the mysql database. With the addition of the cross-reference table being included in the sqlite3 db.

Jmainguy commented 3 years ago

Here is the result of the tests being run against the sqlite database. Only finding issues with t_bbe now (bug for bug compatible with whats in mysql, which means, the mysql database needs to be fixed for the t_bbe)

--- FAIL: TestVerseCount (0.00s)
    sqlite_test.go:53: 
            Error Trace:    sqlite_test.go:53
            Error:          Not equal: 
                            expected: 31102
                            actual  : 31103
            Test:           TestVerseCount
            Messages:       Should only be 31102 verses in t_bbe translation
--- FAIL: TestGenesisChapterFortyTwoTotalVerseCount (0.02s)
    sqlite_test.go:714: 
            Error Trace:    sqlite_test.go:714
            Error:          Not equal: 
                            expected: 38
                            actual  : 39
            Test:           TestGenesisChapterFortyTwoTotalVerseCount
            Messages:       Should only be 38 verses in chapter 42 of Genesis book in t_bbe translation
--- FAIL: TestGenesisChapterFortyThreeTotalVerseCount (0.02s)
    sqlite_test.go:729: 
            Error Trace:    sqlite_test.go:729
            Error:          Not equal: 
                            expected: 34
                            actual  : 33
            Test:           TestGenesisChapterFortyThreeTotalVerseCount
            Messages:       Should only be 34 verses in chapter 43 of Genesis book in t_bbe translation
--- FAIL: TestLeviticusChapterFiveTotalVerseCount (0.02s)
    sqlite_test.go:1537: 
            Error Trace:    sqlite_test.go:1537
            Error:          Not equal: 
                            expected: 19
                            actual  : 26
            Test:           TestLeviticusChapterFiveTotalVerseCount
            Messages:       Should only be 19 verses in chapter 5 of Leviticus book in t_bbe translation
--- FAIL: TestLeviticusChapterSixTotalVerseCount (0.02s)
    sqlite_test.go:1552: 
            Error Trace:    sqlite_test.go:1552
            Error:          Not equal: 
                            expected: 30
                            actual  : 23
            Test:           TestLeviticusChapterSixTotalVerseCount
            Messages:       Should only be 30 verses in chapter 6 of Leviticus book in t_bbe translation
--- FAIL: TestNumbersChapterTwentyNineTotalVerseCount (0.02s)
    sqlite_test.go:2316: 
            Error Trace:    sqlite_test.go:2316
            Error:          Not equal: 
                            expected: 40
                            actual  : 39
            Test:           TestNumbersChapterTwentyNineTotalVerseCount
            Messages:       Should only be 40 verses in chapter 29 of Numbers book in t_bbe translation
--- FAIL: TestNumbersChapterThirtyTotalVerseCount (0.02s)
    sqlite_test.go:2331: 
            Error Trace:    sqlite_test.go:2331
            Error:          Not equal: 
                            expected: 16
                            actual  : 17
            Test:           TestNumbersChapterThirtyTotalVerseCount
            Messages:       Should only be 16 verses in chapter 30 of Numbers book in t_bbe translation
--- FAIL: TestFirstSamuelChapterTwentyThreeTotalVerseCount (0.02s)
    sqlite_test.go:4081: 
            Error Trace:    sqlite_test.go:4081
            Error:          Not equal: 
                            expected: 29
                            actual  : 28
            Test:           TestFirstSamuelChapterTwentyThreeTotalVerseCount
            Messages:       Should only be 29 verses in chapter 23 of 1 Samuel book in t_bbe translation
--- FAIL: TestFirstSamuelChapterTwentyFourTotalVerseCount (0.02s)
    sqlite_test.go:4096: 
            Error Trace:    sqlite_test.go:4096
            Error:          Not equal: 
                            expected: 22
                            actual  : 23
            Test:           TestFirstSamuelChapterTwentyFourTotalVerseCount
            Messages:       Should only be 22 verses in chapter 24 of 1 Samuel book in t_bbe translation
--- FAIL: TestJobChapterThirtyEightTotalVerseCount (0.02s)
    sqlite_test.go:7432: 
            Error Trace:    sqlite_test.go:7432
            Error:          Not equal: 
                            expected: 41
                            actual  : 38
            Test:           TestJobChapterThirtyEightTotalVerseCount
            Messages:       Should only be 41 verses in chapter 38 of Job book in t_bbe translation
--- FAIL: TestJobChapterThirtyNineTotalVerseCount (0.02s)
    sqlite_test.go:7447: 
            Error Trace:    sqlite_test.go:7447
            Error:          Not equal: 
                            expected: 30
                            actual  : 38
            Test:           TestJobChapterThirtyNineTotalVerseCount
            Messages:       Should only be 30 verses in chapter 39 of Job book in t_bbe translation
--- FAIL: TestJobChapterFortyTotalVerseCount (0.02s)
    sqlite_test.go:7462: 
            Error Trace:    sqlite_test.go:7462
            Error:          Not equal: 
                            expected: 24
                            actual  : 28
            Test:           TestJobChapterFortyTotalVerseCount
            Messages:       Should only be 24 verses in chapter 40 of Job book in t_bbe translation
--- FAIL: TestJobChapterFortyOneTotalVerseCount (0.02s)
    sqlite_test.go:7477: 
            Error Trace:    sqlite_test.go:7477
            Error:          Not equal: 
                            expected: 34
                            actual  : 25
            Test:           TestJobChapterFortyOneTotalVerseCount
            Messages:       Should only be 34 verses in chapter 41 of Job book in t_bbe translation
--- FAIL: TestEcclesiastesChapterFourTotalVerseCount (0.02s)
    sqlite_test.go:10309: 
            Error Trace:    sqlite_test.go:10309
            Error:          Not equal: 
                            expected: 16
                            actual  : 17
            Test:           TestEcclesiastesChapterFourTotalVerseCount
            Messages:       Should only be 16 verses in chapter 4 of Ecclesiastes book in t_bbe translation
--- FAIL: TestEcclesiastesChapterFiveTotalVerseCount (0.02s)
    sqlite_test.go:10324: 
            Error Trace:    sqlite_test.go:10324
            Error:          Not equal: 
                            expected: 20
                            actual  : 19
            Test:           TestEcclesiastesChapterFiveTotalVerseCount
            Messages:       Should only be 20 verses in chapter 5 of Ecclesiastes book in t_bbe translation
--- FAIL: TestDanielChapterFiveTotalVerseCount (0.02s)
    sqlite_test.go:13273: 
            Error Trace:    sqlite_test.go:13273
            Error:          Not equal: 
                            expected: 31
                            actual  : 30
            Test:           TestDanielChapterFiveTotalVerseCount
            Messages:       Should only be 31 verses in chapter 5 of Daniel book in t_bbe translation
--- FAIL: TestDanielChapterSixTotalVerseCount (0.02s)
    sqlite_test.go:13288: 
            Error Trace:    sqlite_test.go:13288
            Error:          Not equal: 
                            expected: 28
                            actual  : 29
            Test:           TestDanielChapterSixTotalVerseCount
            Messages:       Should only be 28 verses in chapter 6 of Daniel book in t_bbe translation
--- FAIL: TestHoseaChapterElevenTotalVerseCount (0.02s)
    sqlite_test.go:13557: 
            Error Trace:    sqlite_test.go:13557
            Error:          Not equal: 
                            expected: 12
                            actual  : 11
            Test:           TestHoseaChapterElevenTotalVerseCount
            Messages:       Should only be 12 verses in chapter 11 of Hosea book in t_bbe translation
--- FAIL: TestHoseaChapterTwelveTotalVerseCount (0.02s)
    sqlite_test.go:13572: 
            Error Trace:    sqlite_test.go:13572
            Error:          Not equal: 
                            expected: 14
                            actual  : 15
            Test:           TestHoseaChapterTwelveTotalVerseCount
            Messages:       Should only be 14 verses in chapter 12 of Hosea book in t_bbe translation
--- FAIL: TestHoseaChapterThirteenTotalVerseCount (0.02s)
    sqlite_test.go:13587: 
            Error Trace:    sqlite_test.go:13587
            Error:          Not equal: 
                            expected: 16
                            actual  : 15
            Test:           TestHoseaChapterThirteenTotalVerseCount
            Messages:       Should only be 16 verses in chapter 13 of Hosea book in t_bbe translation
--- FAIL: TestHoseaChapterFourteenTotalVerseCount (0.02s)
    sqlite_test.go:13602: 
            Error Trace:    sqlite_test.go:13602
            Error:          Not equal: 
                            expected: 9
                            actual  : 10
            Test:           TestHoseaChapterFourteenTotalVerseCount
            Messages:       Should only be 9 verses in chapter 14 of Hosea book in t_bbe translation
--- FAIL: TestJoelChapterTwoTotalVerseCount (0.02s)
    sqlite_test.go:13646: 
            Error Trace:    sqlite_test.go:13646
            Error:          Not equal: 
                            expected: 32
                            actual  : 27
            Test:           TestJoelChapterTwoTotalVerseCount
            Messages:       Should only be 32 verses in chapter 2 of Joel book in t_bbe translation
--- FAIL: TestJoelChapterThreeTotalVerseCount (0.02s)
    sqlite_test.go:13661: 
            Error Trace:    sqlite_test.go:13661
            Error:          Not equal: 
                            expected: 21
                            actual  : 26
            Test:           TestJoelChapterThreeTotalVerseCount
            Messages:       Should only be 21 verses in chapter 3 of Joel book in t_bbe translation
--- FAIL: TestJonahChapterOneTotalVerseCount (0.02s)
    sqlite_test.go:13868: 
            Error Trace:    sqlite_test.go:13868
            Error:          Not equal: 
                            expected: 17
                            actual  : 16
            Test:           TestJonahChapterOneTotalVerseCount
            Messages:       Should only be 17 verses in chapter 1 of Jonah book in t_bbe translation
--- FAIL: TestJonahChapterTwoTotalVerseCount (0.02s)
    sqlite_test.go:13883: 
            Error Trace:    sqlite_test.go:13883
            Error:          Not equal: 
                            expected: 10
                            actual  : 11
            Test:           TestJonahChapterTwoTotalVerseCount
            Messages:       Should only be 10 verses in chapter 2 of Jonah book in t_bbe translation
--- FAIL: TestMicahChapterFourTotalVerseCount (0.02s)
    sqlite_test.go:13987: 
            Error Trace:    sqlite_test.go:13987
            Error:          Not equal: 
                            expected: 13
                            actual  : 14
            Test:           TestMicahChapterFourTotalVerseCount
            Messages:       Should only be 13 verses in chapter 4 of Micah book in t_bbe translation
--- FAIL: TestMicahChapterFiveTotalVerseCount (0.02s)
    sqlite_test.go:14002: 
            Error Trace:    sqlite_test.go:14002
            Error:          Not equal: 
                            expected: 15
                            actual  : 14
            Test:           TestMicahChapterFiveTotalVerseCount
            Messages:       Should only be 15 verses in chapter 5 of Micah book in t_bbe translation
--- FAIL: TestNahumChapterOneTotalVerseCount (0.02s)
    sqlite_test.go:14061: 
            Error Trace:    sqlite_test.go:14061
            Error:          Not equal: 
                            expected: 15
                            actual  : 14
            Test:           TestNahumChapterOneTotalVerseCount
            Messages:       Should only be 15 verses in chapter 1 of Nahum book in t_bbe translation
--- FAIL: TestNahumChapterTwoTotalVerseCount (0.02s)
    sqlite_test.go:14076: 
            Error Trace:    sqlite_test.go:14076
            Error:          Not equal: 
                            expected: 13
                            actual  : 14
            Test:           TestNahumChapterTwoTotalVerseCount
            Messages:       Should only be 13 verses in chapter 2 of Nahum book in t_bbe translation
--- FAIL: TestZechariahChapterOneTotalVerseCount (0.02s)
    sqlite_test.go:14282: 
            Error Trace:    sqlite_test.go:14282
            Error:          Not equal: 
                            expected: 21
                            actual  : 17
            Test:           TestZechariahChapterOneTotalVerseCount
            Messages:       Should only be 21 verses in chapter 1 of Zechariah book in t_bbe translation
--- FAIL: TestZechariahChapterTwoTotalVerseCount (0.02s)
    sqlite_test.go:14297: 
            Error Trace:    sqlite_test.go:14297
            Error:          Not equal: 
                            expected: 13
                            actual  : 17
            Test:           TestZechariahChapterTwoTotalVerseCount
            Messages:       Should only be 13 verses in chapter 2 of Zechariah book in t_bbe translation
--- FAIL: TestThirdJohnChapterOneTotalVerseCount (0.02s)
    sqlite_test.go:18456: 
            Error Trace:    sqlite_test.go:18456
            Error:          Not equal: 
                            expected: 14
                            actual  : 15
            Test:           TestThirdJohnChapterOneTotalVerseCount
            Messages:       Should only be 14 verses in chapter 1 of 3 John book in t_bbe translation
leojonathanoh commented 3 years ago

This is useful fix. Was wondering what the mysql error was about when i used docker-compose too.

scrollmapper commented 2 years ago

Thank you. I'm doing some work on this repo today. I'll accept this change.